Answered step by step
Verified Expert Solution
Question
1 Approved Answer
roject: Using Java API Classes Page 3 of 5 Project: Using Java API Classes Page 4 of 5 Code: To receive full credit for this
roject: Using Java API Classes Page 3 of 5 Project: Using Java API Classes Page 4 of 5 Code: To receive full credit for this assignment, you must use the appropriate Java API classes and method to do the calculation and formatting. It is recommended as a practice that you do not modily the input value onee it is stored. Test: You will be responsible for testing your program, and it is important to not rely only on the examples above. Assume that the amount entered can be any positive or negative floating-point number. - HotelBill.java Requirements: The purpose of this program is to accept a hotel bill code as input that includes the room number, price per night, check-in date, and number of nights, followed by the guest's name. The program should then print the hotel bill containing the information read in along with the cost per night price (room and 15% tax) and the total cost for the stay. The last line of the reservation should contain a "lucky number" between 1 and 999999 inclusive that should always be printed as six digits (e.g., 1 should be printed as 000001 ). The coded input is formatted as follows: The cntire line with the botel bill code should be read in at one time, and any whatespoce before or after the coded information should be trimmed (c.g., if the user cnters spaces before the coded information or after it, the spaces should be disregarded by using the trim method). Your progrum will need to priat the name, room, check-in date, number of nights, cost per night (including room and tax), total for the stay, and a random "lucky" number in the range 1 to 999999. If the user enters a code that does not have at least 22 characters, then an error message should be printed. [The numeric values for priee and nights nust be provided in the 21 characters; otherwise, a runtime exception may occur.] Design: Several examples of inputloutput for the progran are shown below. Example \#I \begin{tabular}{|l|l|} \hline Line # & lrogram output \\ \hline 1 & Enter hotel bi11 code : 123456789 \\ 2 & Invalid Hotel Bil1 Code. \\ 3 & Hotel Bill Code must have at least 22 characters. \\ 4 & \\ 5 & \\ \hline \end{tabular} Page 3 of 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started