private static void Display(BoatLicense lic) { Console.WriteLine("Boat #{0} from {1} has a {2} HP motor.", lic.Licensenum, lic.State, MotorSizeInHP); Console.WriteLine(" The price for the license is \n", lic.Price.ToString("C2")); }
internal static void Display(BoatLicense lic) { WriteLine("Boat #{0} from {1} has a {2} HP motor.", lic.LicenseNum, lic.State, lic.MotorSizeInHP);//added comma WriteLine(" The price for the license is {0}\n", lic.Price.ToString("C2")); }
public void BoatLicenseTest3() { BoatLicense boat = new BoatLicense(); boat.LicenseNum = "HRL89S"; boat.State = "MN"; boat.MotorSizeInHP = 100; Assert.AreEqual("HRL89S", boat.LicenseNum); Assert.AreEqual("MN", boat.State); Assert.AreEqual(100, boat.MotorSizeInHP); Assert.AreEqual(38, boat.Price); }
public void BoatLicenseTest2() { BoatLicense boat = new BoatLicense(); boat.LicenseNum = "GHHTR53"; boat.State = "WI"; boat.MotorSizeInHP = 50; Assert.AreEqual("GHHTR53", boat.LicenseNum); Assert.AreEqual("WI", boat.State); Assert.AreEqual(50, boat.MotorSizeInHP); Assert.AreEqual(25, boat.Price); }
public void BoatLicenseTest1() { BoatLicense boat = new BoatLicense(); boat.LicenseNum = "290u45"; boat.State = "NM"; boat.MotorSizeInHP = 30; Assert.AreEqual("290u45", boat.LicenseNum); Assert.AreEqual("NM", boat.State); Assert.AreEqual(30, boat.MotorSizeInHP); Assert.AreEqual(25, boat.Price); }
public static void Main() { const int STARTINGNUM = 201201; BoatLicense[] license = new BoatLicense[3]; int x; for(x = 0; x < license.Length; ++x) { license[x] = new BoatLicense(); license[x].LicenseNum = ("" + x + STARTINGNUM); } license[0].State = "WI"; license[1].State = "MI"; license[2].State = "MN"; license[0].MotorSizeInHP = 30; license[1].MotorSizeInHP = 50; license[2].MotorSizeInHP = 100; for(x = 0; x < license.Length; ++x) Display(license); }
public static void NineFour() { const int STARTING_NUM = 201601; BoatLicense[] license = new BoatLicense[3]; int x; for (x = 0; x < license.Length; ++x) { license[x] = new BoatLicense(); license[x].LicenseNum = ("" + x + STARTING_NUM); } license[0].State = "WI"; license[1].State = "MI"; license[2].State = "MN"; license[0].MotorSizeInHP = 30; license[1].MotorSizeInHP = 50; license[2].MotorSizeInHP = 100; for (x = 0; x < license.Length; ++x) { Display(license[x]); } }
static void Main() { const string STARTINGNUM = "201601"; BoatLicense[] license = new BoatLicense[3]; int x; for (x = 0; x < license.Length; ++x) { license[x] = new BoatLicense(); license[x].LicenseNum = (x.ToString() + STARTINGNUM); } license[0].State = "WI"; license[1].State = "MI"; license[2].State = "MN"; license[0].MotorSizeInHP = 30; license[1].MotorSizeInHP = 50; license[2].MotorSizeInHP = 100; for (x = 0; x < license.Length; ++x) { Display(license[x]); } }
static void Main(string[] args) { const int STARTING_NUM = 201601; BoatLicense[] license = new BoatLicense[3]; int x; for (x = 0; x < license.Length; ++x) { license[x] = new BoatLicense(); license[x].LicenseNum = (STARTING_NUM + x).ToString(); } license[0].State = "WI"; license[1].State = "MI"; license[2].State = "MN"; license[0].MotorSizeInHP = 30; license[1].MotorSizeInHP = 50; license[2].MotorSizeInHP = 100; for (x = 0; x < license.Length; ++x) { Display(license[x]); } }
public static void Display(BoatLicense license) { Console.WriteLine("Boat #{0} from {1} has a {2} HP motor.", license.LicenseNum, license.State, license.MotorSizeInHP); Console.WriteLine(" The price for the license is {0}\n", license.Price.ToString("C2")); }