public void MyCode() { // The FIRST line of code should be BELOW this line //Creates FruitBox object and prints description FruitBox f1 = new FruitBox(2.95, 1.5); Console.WriteLine(f1.GetBoxContentDescription()); //Adding fruit f1.AddApples(12); f1.AddBananas(7); Console.WriteLine(f1.GetBoxContentDescription()); // Gets total price of FruitBox Console.WriteLine("The total price of the fruitbox is {0} kr", f1.GetTotalPrice()); // Updates price of banana and apple and prints new total f1.NewBananaPrice(1); f1.NewApplePrice(1); Console.WriteLine("The total price of the fruitbox is {0} kr", f1.GetTotalPrice()); // The LAST line of code should be ABOVE this line }
public void MyCode() { // The FIRST line of code should be BELOW this line FruitBox fruitBox = new FruitBox(2, 1.5); Console.WriteLine(fruitBox.GetBoxContentDescription()); fruitBox.AddApples(10); fruitBox.AddBananas(5); Console.WriteLine("....................."); Console.WriteLine(fruitBox.GetBoxContentDescription()); Console.WriteLine("The content of the box costs a total of {0}kr", fruitBox.getTotalPrice()); Console.WriteLine("....................."); Console.WriteLine("Now we are changing prices to 3kr pr. banana and 2kr pr. apple..."); fruitBox.NewFruitPrices(3, 2); Console.WriteLine("The content of the box costs a total of {0}kr", fruitBox.getTotalPrice()); // The LAST line of code should be ABOVE this line }