Use the following code to answer the questions that follows: 1. class Car:Vehicle 2. { public…

  1. Use the following code to answer the questions that follows:

1. class Car:Vehicle 2. {

  1. public string carName;
  2. public string carModel;
  3. public Engine engineA;
  4. public Car(string aName, string aModel, int eCapacity) 7. {
  1. carName = aName;
  2. carModel = aModel;
  3. engineA = new Engine(eCapacity);

11. }

12. }

13. class Engine

14. {

  1. public string engineBlock;//The block is the main part of the engine.
  2. public string Crankshaft;
  3. public int capacity;//Located near the bottom of the engine block
  4. public Engine(int getCapacity)

19. {

20. capacity = getCapacity;

21. }

22. }

23. class Vehicle

24. {

  1. Public int registrationNumber;
  2. Person owner;

27. }

28. public partial class PrintOutput : Form

29.

{

30.

public PrintOutput ()

31.

{

32.

InitializeComponent();

33.

Car myCar = new Car(252,”Toyota”, “Avanza”, 71,4);

34.

MessageBox.Show(myCar.carName + myCar.carModel +

myCar.engineA.capacity.ToString())

35. }

}

1.1) What type of class modelling is exhibited in line 1?

1.2) Describe the benefits of this type of modelling

1.3)

  1. When compiled, would the program run without any errors when the following inputs are given (Do not make any assumption)? Motivate/explain your answer. If you think the program has some errors, write the code to rectify them, so that the program does run.

Car registration number: 252

Car Name: Toyota

Car model: Avanza Car engine capacity: 71 Car doors: 4.

1.4) Draw a class diagram to represent this code and the entire context provided

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!