David Marks Staff asked 5 years ago

Objectives This assessment item is designed to test your understanding of variables, constants, types, operators, standard console input/output, loops, if statements, classes, objects and methods. Assessment task Write a Java application that calculates and displays rentals of hiring car for N customers who hire cars from a local car rental company based in Rockhampton, Australia. N should be declared as a constant and should be equal to the largest digit of your student id number (e.g. if your student id is s0705544 then N should be equal to 7). Assume N=4, if the largest digit of your student id number is less than 4. The standard charges of car rental from this company are shown below in Table 1. Table 1. The standard charges for car rentals Days of rental Charge 1 ? 5 days \$25.0/per day (base rate) 6 ? 10 days \$22.5/per day More than 10 days \$21.0/per day The application should ask the user to enter the customer name, the number of days for renting a car, and yes or no to indicate whether the customer receives a special offer or not. The special offer will give customers a 10% discount of the rental no matter how many days they hire a car. Assume that the number of days to be entered is an integer type with the range between 1 and 365. An error message should be issued if a user enters a value beyond this range and the re-entering is required. After entering the above three data items, the program makes a calculation of rental and displays the result as shown in Figure 1. The program should be kept running with entering next set of input data. After all N sets of input data are entered from the keyboard, if the calculation of your program is successfully finished, the execution of your program will also display the information that includes the customer spending most rental, the customer spending least rental as well as a simple statistics bar chart to display how many rents with the number of days are less than 7 days and greater than/equal 7 days in two lines respectively.(Based on historical statistics, most customers hire a car for a period of 7 days). These requirements and the result also can be shown in Figure 2 on next page. Your program should display a similar screen image when it runs. The application should be user-friendly by displaying appropriate welcome, exit and error message. Please note: (1)For simplicity, ignore some complicated factors such as car type, fuel usage, running kilometres in the real-world application. This is a simplified computation model for our purpose of programming exercise. (2)A special offer can be represented by a boolean variable with the value of true/false, or an integer variable with the value of 1 and 0, or a String variable with the value of yes or no (you can use String class built-in method equal( ) to compare two strings); and (3) If the value of N is re-set, your program should be run as normal without changing any source code except setting N with a different value. The application can be implemented in a few of different ways. One of implementations is to use the following classes and methods: public class CarRental { //declare data members public CarRental( ) //constructor public void setName(String n) public String getName() public void setDays(int d) public int getDays() public double calulateRental() public void displayInfo() } public class CarRentalTest { public static main(String [ ] args) { //declare data members // create Scanner object, create a CarRental Object // use a loop to read data, call methods } } Alternatively, the another implementation can be illustrated as below: public class CarRental { //declare data members public CarRental( ) //constructor public void inputData()// using Scanner, using loops public double calulateRental() public void displayInfo() } public class CarRentalTest { public static main(String [ ] args) { //simply create a CarRental object //call relevant methods } } You can implement this application in either way as above (or other similar way), provided your program works fine and produces the expected result that meets the specified requirements

Free assignment help .com  an online tutoring company, provides students with a wide range of Free assignment help services for students studying in classes K-12, and College or university.

The Expert team of professional online assignment help tutors at Online assignment help .com AU provides a wide range of help with assignments through services such as college assignment help, university assignment help, homework assignment help, email assignment help and online assignment help. Our expert team consists of passionate and professional assignment help tutors, having masters and PhD degrees from the best universities of the world, from different countries like Australia,  United Kingdom,  United States, Canada, UAE and many more who give the best quality and plagiarism free answers of the assignment help questions submitted by students, on sharp deadline.

Free assignment help  t tutors are available 24×7 to provide assignment help in diverse fields – Math, Chemistry, Physics, Writing, Thesis, Essay, Accounting, Finance, Data Analysis, Case Studies, Term Papers, and Projects etc. We also provide assistance to the problems in programming languages such as C/C++, Java, Python, Matlab, .Net, Engineering assignment help and Finance assignment help.

The expert team of certified online tutors in diverse fields at Free assignment help .com  available around the clock (24×7) to provide live help to students with their assignment and questions. We have also excelled in providing E-education with latest web technology. The Students can communicate with our online assignment tutors using voice, video and an interactive white board. We help students in solving their problems, assignments, tests and in study plans. You will feel like you are learning from a highly skilled online tutor in person just like in classroom teaching. You can see what the tutor is writing, and at the same time you can ask the questions which arise in your mind. You only need a PC with Internet connection or a Laptop with Wi-Fi Internet access.

We provide live online tutoring which can be accessed at anytime and anywhere according to student’s convenience. We have tutors in every subject such as Math, Chemistry, Biology, Physics and English whatever be the school level. Our college and university level tutors provide engineering online tutoring in areas such as Computer Science, Electrical and Electronics engineering, Mechanical engineering and Chemical engineering.