Assignment title: Management


Assignment 1 This assignment requires you to develop and submit a program to demonstrate that you understand the programming concepts presented from week 1 to week 7. The focus of this program is mainly on the use of arrays to store data about multiple entries, and the use of methods to modularize code. Create a new C# console application project in Visual Studio and name the project ass1. Program description: Develop a program that produces invoices for a car rental firm. The program should incorporate the following functionality: Store a maximum of 100 records for functions containing the following:  Name of customer  Address  Car registration number  Car type - Small, Medium or Large  "Peace of Mind" Extra insurance (ie. Reduce excess payable to $ 0) - Y or N  Duration of rental - days  Start Kms  End Kms  Credit card type - Visa or Mastercard only  Credit card number Provide program functionality to allow the user to enter a new , search for a function, edit an existing function, delete a function record and display costings for any selected function. The program must operate via a menu system. Menu option entries may be in upper or lower case. The menu to control the program should be as follows:  Enter car rental details (r)  Search for a car rental (s)  Edit a car rental (e)  Delete a car rental (d)  Produce invoice (i)  Exit (x) SIT102 Introduction to Programming – Deakin College Trimester 3 2015 2 Enter car rental details (r) should do the following: Collect and store the following information from the user:  Name of customer  Address  Car registration number  Car type  "Peace of Mind" Extra insurance (ie. Reduce excess payable to $ 0)  Duration of rental (days)  Start Kms  End Kms  Credit card type  Credit card number All inputs are to be validated as follows. Where an error is detected in the data entry process the program must display an appropriate message and then re prompt the user to allow them to re-enter the data.  No inputs are to be left blank.  Car registration number must be exactly 6 characters long and must start with either Z or 1.  Car type must be one of the following and can be entered as either upper or lower case: S for small car (Hyundai i20 or similar), M for medium car (Toyota Corolla or similar), L for large car (Holden Commodore or similar).  "Peace of Mind" Extra insurance must be one of the following and can be entered as either upper or lower case: Y for Yes, N for No (extra insurance not required).  Duration of rental must be an integer greater than 0.  Start Kilometres must be an integer greater than 0.  End Kilometres must be an integer greater than Start Kilometres.  Credit card type must be one of the following and can be entered as either upper or lower case: V for Visa, M for Mastercard.  Credit card numbers must contain exactly 16 digits. Visa card numbers must begin with 4 and Mastercard numbers must begin with 5. SIT102 Introduction to Programming – Deakin College Trimester 3 2015 3 Search for a car rental (s) Prompt for the Customer Name to search for.  The user may enter all or part of the customer name.  Search through all of the customer names stored until a match is found and return the address, car registration number, duration of rental, start Kms and end Kms.  Prompt the user whether it is the correct rental record.  If it is the correct record then that record will be the current record to be used when editing a record, deleting a record or producing an invoice. If no matching customer name is found then the last current record remains current Note: This option should only be accessible after valid rental details have been entered into the system. Edit rental details (e) should do the following: This option is to be used to amend any details about a customer and their car rental that may have changed. First perform a search (see above) to display the required record and then display the fields one at a time, each time asking the user if they wish to enter a new value or not. For example: Name of customer : Fred Krueger Update this information (Y or N) : N Address : 13 Elm St Burwood Update this information (Y or N) : N Car registration number : XYZ123 Update this information (Y or N) : N Car type (S,M or L) : M Update this information (Y or N) : N "Peace of Mind" insurance (Y or N): Y Update this information (Y or N) : N Duration of rental (days) : 13 Update this information (Y or N) : Y Duration of rental (days) : 14 Start Kms : 13131 Update this information (Y or N) : N End Kms : 14444 Update this information (Y or N) : N Credit card type (V or M) : V Update this information (Y or N) : N Credit card number : 4123456789123456 SIT102 Introduction to Programming – Deakin College Trimester 3 2015 4 Note: This option should only be accessible after valid car rental details have been entered into the system. Delete a car rental (d) Delete the current car rental details  Ensure that you display the car rental details and then ask the user to confirm that they want to delete this record before actually deleting the record.  For the purpose of this assignment deleting the record will consist of overwriting the contents of the record in the arrays with a null string or 0 as appropriate for the data type.in the array. Note: This option should only be accessible after valid car rental details have been entered into the system. Produce Invoice (i) should do the following: The cost of the car rental is calculated as follows: The rental fee is based on the number of days that the car has been rented for multiplied by daily rate for the car type as follows: Car Type Daily rate Small (Hyundai i20 or similar) $ 52 Medium (Toyota Corolla or similar) $ 59 Large (Holden Commodore or similar) $ 70 If the number of kilometres travelled exceeds 2400 Kms then an extra fee of 28 cents per kilometre travelled beyond the 2400 is added. Insurance is included as part of the rental cost but in the case of an accident the customer still has to pay the first $3000 towards any damage that has occurred. This excess can be reduced to $ 0 by purchasing extra insurance. If the customer has opted for this extra insurance then a fee of $36 per day is added. The total cost of rental is thus the sum of the rental fee, the charge for extra kilometres (if applicable) and the extra insurance fee (if applicable). A Goods and Service Tax (GST) of 10% is then added to the total cost of rental to give the total amount to be invoiced. SIT102 Introduction to Programming – Deakin College Trimester 3 2015 5 Display the results as follows: CAR RENTAL INVOICE prepared for: Fred Krueger Address : 13 Elm St Burwood Car type : Medium Car registration number : XYZ123 Duration of rental : 13 days Kilometres travelled : 1313 Credit card type : Visa Credit card number : 4123456789123456 Rental fee : $ 767.00 Extra insurance fee : $ 476.61 Total rental cost : $ 1243.71 GST : $ 124.37 --------- TOTAL INVOICED AMOUNT : $ 1368.08 Note: This option should only be accessible after valid product details have been entered into the system. Exit (x) Exit the program. Requirements: You may use the solution provided for practical test 3 or your own code to enhance and change the program to suit the assignment 1 specifications. Appropriate input data validation techniques must be used to prevent the program from crashing. When an error is detected in the data entry process, the program should display an appropriate message and then re-prompt the user to enter the data again. You must use methods in your code. Methods could include:  DisplayMenu()  AddRental()  FindRental()  EditRental()  DeleteRental()  ProduceInvoice() SIT102 Introduction to Programming – Deakin College Trimester 3 2015 6 Other methods may be created as required. Data must be passed to the methods. You must use arrays to store the car rental data (Customer Name, Address, Car registration number, Car type, Extra insurance taken, Duration of rental, Start Kms, End Kms, Credit card type, Credit card number). You must declare the arrays within Main() and pass the arrays to the methods. Ensure that you place a comment at the top of the program that contains your full name and student number. Place comments in your code as required and ensure that you layout your code appropriately. Marks will be allocated as follows:  5 marks for the use of arrays to store and manipulate the car rental details  5 marks for the creation and use of methods to manage the code  3 marks for correctly making decisions, performing calculations and managing the data within the program  2 marks for overall, design, layout and commenting Submission instructions :  Zip up the entire project folder and all files and folder within. NOTE: Do NOT create RAR or 7Z files instead of ZIP.  Name the zip file sit102-Ass1-.zip where is replaced with your student number. For example, sit102-Ass1- WKSAL12.zip  Submit the file via the assignment submission link in Moodle.