Esempio n. 1
0
 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"));
 }
Esempio n. 2
0
 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"));
 }
Esempio n. 3
0
 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"));
 }
Esempio n. 4
0
    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);
    }
Esempio n. 5
0
    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);
    }
Esempio n. 6
0
    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);
    }
Esempio n. 7
0
 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);
 }
Esempio n. 8
0
    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]);
        }
    }
Esempio n. 9
0
    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]);
        }
    }
Esempio n. 10
0
        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]);
            }
        }
Esempio n. 11
0
 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"));
 }