Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A) Add Car (Updated) The add item function of your menu is now being used for adding either a Car or a SilverServiceCar. Update your

A) Add Car (Updated) The add item function of your menu is now being used for adding either a Car or a SilverServiceCar. Update your add function to now prompt the user to indicate if they wish to create a Car or a SilverServiceCar. Based on the user's choice it will now prompt for the appropriate input to finish creating the correct type of object. Example 1: Enter Registration No: SIM194 Enter Make: Honda Enter Model: Accord Euro Enter Driver's Name: Henry Cavill Enter Passenger Capacity: 2 Enter Service Type (SD/SS) SD New Car added successfully for registion number: SIM194. Example 2: Enter registration number: MAT412 Enter Make: Honda Enter Model: Accord Enter Driver Name: Matt Bomer Enter number of passengers: 4 Enter Service Type (SD/SS): SS Enter Standard Fee: 3.50 Enter List of Refreshments: Mints,Orange Juice,Chocolate Bar New Car added successfully for registion number: MAT412 The objects should be stored in the next available (empty) position in the same array used to store both Car and SilverService cars. Stage 2 of the Assignment continues on the next page ... COSC1284 - Programming Techniques Programming Techniques Assignment 2 Page 7 of 14 B) Search for available cars (date & time) This feature should begin by prompting the user to enter a date and a vehicle type i.e. Standard or SilverService. All cars that match the required details should have their full details printed to the console. If no matching Cars were found then a suitable error message should be displayed to the screen. Example 1: Enter Type (SD/SS): SD Date: 07/03/2019 "Error - No cars were found on this date." If one or more cars were found then the full details should be printed to the console. Example 1: Reg No: NIS591 Make & Model: Nissan Rover Driver Name: Jonathon Ryss Meyers Capacity: 7 Standard Fee: 3.5 Refreshments Available Item 1 Mints Item 2 Orange Juice Item 3 Chocolate Bar Example 2: Reg No: ROV465 Make & Model: Jaguar Rover Driver Name: Jonathon Ryss Meyers Capacity: 7 Standard Fee: : $3.5 Refreshments Available Item 1 Mints Item 2 Orange Juice Item 3 Chocolate Bar PAST BOOKINGS ________________________________________ id: ROV465NIGLAW23042019 Booking Fee: $3.50 Pick Up Date: 23/04/2019 Name: Nigella Lawson Passengers: 3 Travelled: 75.00km Trip Fee: $105.00 Car Id: ROV465 COSC1284 - Programming Techniques Programming Techniques Assignment 2 Page 8 of 14 C) Display all cars (Registration - Ascending/Descending) You should update the display all cars feature by prompting the user to enter either 'A' for ascending or 'D' for descending. NOTE: You must implement your own sorting logic. You are not permitted to use any built in functions or libraries to achieve the sort. Failure to implement your own sorting will result in a 15 mark penalty. All cars in the order specified should have their full details printed to the console Example 1: Enter Type (SD/SS): SD Enter Sort Order (A/D): D "Error - No standard cars were found on this date." If one or more cars were found then the full details should be printed to the console. Example 2: Enter Type (SD/SS): SD Enter Sort Order (A/D): D The following cars are available ____________________________________________________________ Reg No: LEX356 Make & Model: Lexus M1 Driver Name: Angela Landsbury Capacity: 3 Standard Fee: : 1.5 Available: YES ____________________________________________________________ Reg No: LAM314 Make & Model: Lamborghini Urus Driver Name: Robbie Williams Capacity: 7 Standard Fee: : 1.5 Available: YES PAST BOOKINGS ________________________________________ id: LAM314RODCOC23042019 Booking Fee: $1.50 Pick Up Date: 23/04/2019 Name: Rodney Cocker Passengers: 3 Travelled: 75.00 Trip Fee: 33.75 Car Id: LAM314 COSC1284 - Programming Techniques Programming Techniques Assignment 2 Page 9 of 14 D) Seed Data Update your seed method so that it now pre-populates the collection with an additional 6 SilverServiceCars. The seeded data must contain the following variety of SilverServiceCars. SilverService Cars Two silver service cars that HAVE NOT been booked Two silver service cars that HAVE BEEN been booked, but the bookings have not been completed Two silver service cars that HAVE BEEN booked, and the bookings have been completed If this option is not selected at runtime, then the collection of items should be empty. If the collection of items already has data then, this method should not overwrite the current data and an error message should be displayed to the user.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions