nataschaj / CarVersion3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CarVersion3

Exercise 13

Download the C# project CarVersion3 from the class website. This exercise is only about observing how we can use if-state-ments to implement some business logic. The solution contains a class called Car, in the file Car.cs.

There are three methods in the Car class that use if-statements:

  • IsEconomic
  • IsFamilyCar
  • RentalPricePerDay
  1. For each of these three methods, make sure you understand what the possible return values are, and under what circumstances each value can be returned.

  2. Read the code in InsertCodeHere.cs – it tests the Car class. Before running the program, try to predict the outcome.

  3. Run the program, and check that the outcome is as you predicted. If not, you may need to read the Car class code again

  4. Try to change some of the values used when creating the three Car objects, and see if you can predict the outcome of running the program

About


Languages

Language:C# 100.0%