Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Andwer question in java please Problem Description NATURE VALLEY homestay provides a convenient and comfortable stay for visitors. The resort wants to automate its biling

Andwer question in java please

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Problem Description NATURE VALLEY homestay provides a convenient and comfortable stay for visitors. The resort wants to automate its biling process. Homestay has three different types of rooms "Standard", "Deluxe" and "Cottage". They provide accommodation for a minimum of one day and a maximum of 15 days. - The base room fare for different types of rooms are as shown below in Table 1 - Different room bill components with the values shown below in Table 2 1. Write a Java program to implement the following class diagram. 2. Write the Java interface RoomBillComponent with different room bill components as shown in Table 2 3 RoomDetails Class: Auto-generate the billid starting from 101 (Hint: Use the static variable counter appropriately for the auto-generation purpose) 3. RoomDetails Class: Auto-generate the billid starting from 101(Hint: Use the static variable "counter" appropriately for the auto-generation purpose) a) validateNoOfExtraPerson0 method: 02 persons are allowed extra per room. If the extra person is more than 2 , display an appropriate message on the console. b) validateTypeofRoom0 method: Valid room types are specified in Table 1. If the user entered room is not of these types, display an error message in the console. c) validateNoOfDaysofStay() method: Validate for the number of valid days and display an appropriate message in the console. d) calculateBill 0 method - Invoke validateTypeofRoom() - Invoke validateNoOfDaysOfStay() - Invoke validateNoOfExtraPerson() - Identify the base room fare based on the typeofRoom from the Table 1 - Calculate total bill as: totalBill = totalBill + TAX*totalBill Return totalBill 4 Java Tester Class a) Create a client code to instantiate an object of RoomDetails Class with appropriate values for Customer name, type of room, extra persons, and number of days of stay b) Calculate total bill c) Display the details or sole as shown below Billid: Customer Name: No. of days of Stay: Total Bill

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_2

Step: 3

blur-text-image_3

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

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students explore these related Databases questions