Part B: (20 marks) Write a program according to these class diagram and output results. Booking.java...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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 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 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 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 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
Expert Answer:
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Both high-income and low-income employees are covered by cafeteria plans. Under such plans, all employees may select from a list of non-taxable fringe benefits or they may elect to receive cash in...
-
Discuss how some learners confuse the two terms wave speed and wave frequency when they assume that the terms refer to the same thing?
-
In Exercises find the area of the surface generated by revolving the curve about each given axis. (a) x-axis (b) y-axis x = 1, y = 4 - 2t, 0 t 2
-
North Shore Architectural Stone, Inc., a company that installs limestone in residential and commercial buildings, agreed to supply and install limestone for a property owned by Joseph Vitacco. North...
-
Asquith Electric sold $750,000, 10%, 10-year bonds on January 1, 2014. The bonds were dated January 1 and paid interest on January 1 and July 1. The bonds were sold at 104. Instructions (a) Prepare...
-
1. [10] Is Grtzsch graph M(C5) Hamiltonian? Is the complement of M(C5) Hamilto- nian? Justify your answer.
-
A job order cost sheet for Koskinen SE is shown below. Instructions a. On the basis of the foregoing data, answer the following questions. 1. What was the balance in Work in Process Inventory on...
-
Ashley wants to buy a new BMW that sells for $60,000 today. Its price is increasing at an annual rate of 2 percent. If she has already saved $48,000 as of today, what annual rate of return would she...
-
Old World Charm, Inc. specializes in selling scented candles. The company has established a policy of reordering inventory every other month (which is 6 times per year). A recently employed MBA has...
-
Offshore Drilling Products, Inc., imposes a payback cutoff of three years for its international investment projects. Assume the company has the following two projects available. Year Cash Flow A Cash...
-
Firm XYZ is required to make a $5 million payment in 1 year, and a $4 million payment in 3 years. The firm wants invest in a portfolio of 1-year and 4-year zero-coupon bonds to fund those future...
-
d. How did you or could you involve the child in some of the decisions you made?
-
Amortization schedule. Chuck Ponzi has talked an elderly woman into loaning him $45,000 for a new business venture. She has, however, successfully passed a finance class and requires Chuck to sign a...
-
The density of a liquid is to be determined by an old 1-cm-diameter cylindrical hydrometer whose division marks are completely wiped out. The hydrometer is first dropped in water, and the water level...
-
Archangel Corporation prepared the following variance report. Instructions Fill in the appropriate amounts or letters for the question marks in the report. ARCHANGEL CORPORATION Variance...
-
Find the documentation for the Java Class Library on the Oracle Web site. (At this writing, the link to this documentation is https://docs.oracle.com/javase/8/docs/api/.) Then find the description...
-
Create a program that tests the class Android described in the previous exercise. Previous exercise. Create a class Android whose objects have unique data. The class has the following attributes:...
-
Write a JavaFX program that moves an image toward the location of the mouse. The image shouldnt jump directly to the mouse coordinates (which is what happens in Listing 9.16) but should move a few...
-
Classic LEGO plastic bricks have been fixtures in homes around the world for more than 70 years. Just 15 years ago, The LEGO Group (TLG) was near bankruptcy, spiraling downward and losing money at a...
-
For a sample of data where n = 7 given below: a. Calculate the mean, median, and mode. b. Calculate the range, variance, standard deviation, and coefficient of variation. c. Calculate the Z score....
-
For a sample of data where n = 6 given below: a. Calculate the mean, median, and mode. b. Calculate the range, variance, standard deviation, and coefficient of variation. c. Calculate the Z scores....
Study smarter with the SolutionInn App