Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part B: (20 marks) Write a program according to these class diagram and output results. Booking.java -name: String -address: String -phone: String -price: Double

image text in transcribedimage text in transcribed

Part B: (20 marks) Write a program according to these class diagram and output results. Booking.java -name: String -address: String -phone: String -price: Double -countBooking =0: static int -totalPay=0: static double + Booking() + Booking(name, phone) + getName() + getAddress() + getPhone() + getPrice() + getTotalPay() + setName() + setAddress() + setPhone() + setPrice() + display() Output: C. Administrator: Command Prompt ***************** Booking Details Name of booking=Ali Bin Ismail Name of booking-Ahmad Fauzi Bin Ismail Address of booking-NO.1 Tmn Impiana, 81100 Johor Bahru, Malaysia Phone number 011-23456789 Price RM 200.00 Address of booking-No. Phone number 012-1234567 Price RM 400.00 Price RM 300.00 ***************** TestBooking.java Name of booking-Siti Aminah Binti Mahnud Address of booking-No. 3 Tmn Cemerlang, 83000 Batu Pahat, Malaysia Phone number-019-3867534 C:\> + static void main() 2 Imn Bahagia, 84000 Muar, Malaysia Total Booking:3 Total payment received: RM900.00 ********M-M-N-3-3-3-3-3-3 0 X Part C: (10 marks) Display the results in Part B using appropriate dialog box as shown. C. Administrator: Command Prompt - java TestBookingJO C:\>javac TestBookingJO.java C:\>java TestBooking J0 ***************** Booking Details ***************** Name of booking-Ahmad Fauzi Bin Ismail Address of booking-NO.1 Inn Impiana, 81100 J Phone number 011-23456789 Price RM 200.00 Total Booking i Total payment received:RM 900.0 Name of booking Ali Bin Ismail Address of booking-No. 2 Tmn Bahagia, 84000 Muar, Malaysia Phone number-012-1234567 Price RM 400.00 10 Name of booking-Siti Aminah Binti Mahmud Address of booking-No. 3 Inn Cemerlang, 83000 Batu Pahat, Malaysia Phone number-019-3867534 Price = RM 300.00 X

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

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Programming questions