



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Student Full Name: I Got You Bro Student Gnumber: Student Email: [email protected] This is a closed book, closed note exam. No use of calculator is allowed during the exam. The exam is 25 % of the final course grade. The total grade is 50.
c) Public void foo(int b, int c){ if(c<0) return; for (int b=0; b< 10 ; b++) c = c+b; System.out.println(c); } Else statement needed for the times when value is more then or equal to 0
This is a hotel room reservation application. Customers are three types: 1 ) new customers, 2 ) returning customers, 3 ) gold customers. The room prices for new customers are 3 rd^ night free, for returning customers are 20 % off of every night, and for gold members is 30 % off. Use inheritance to model this (customer is the super class for firstTimeCustomer, returningCustomer, and goldMemberCustomer). The following fields and methods must be implemented for every customer of any type:
Create the java code for the program using the same theme followed in the lecture. Note that the second menu must pop up every time for a new customer to interact with the application as long as the program is running. Provide the required Mutators and Accessors to communicate with the fields of classes from external classes. Hint: suppose that the maximum length of the customers array is 100 , and assume this is the upper bound for a hotel. Hint: to create an array of class ABCwith length 10 , you should use: ABC[] abcObj = new ABC[ 10 ];