Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write and test a FriendsMeetup class. This class will serve as a driver program for Part A and should be saved in the same folder

Write and test a FriendsMeetup class. This class will serve as a driver program for Part A and should be saved in the same folder as the Tab class. In the main method of the FriendsMeetup class, include statements to support the following (in this order): Mike Smith arrives first. He decides to sit at seat 3 and opens a tab. Create a Tab object called mikesTab.

Mike orders a Coke, which costs 2.50. Sarah Jones, who wants to sit at the end in seat 1, opens a tab; call this object variable sarahsTab. Sarah orders an iced-tea at a cost of 2.85.

Jin Chen sits beside Sarah at seat 2, and he is the next to open a tab; call this object variable jinsTab.

Jin chooses a milkshake, at a cost of 5.50. Ella Paul, who sits across from Mike at seat 7, also opens a tab; call this object variable ellasTab. Ella orders an orange juice for herself for 2.75, and then orders a salad for 7.50. (Use two separate statements, one for each purchase.) Sarah then orders the stir-fry, which costs 15.50.

Jin decides to order a plate of nachos; this costs 12.75. Mike is really hungry so he orders the calamari appetizer for 8.75 and a burger, which costs 13.45. (Use two separate statements, one for each purchase.)

After Ella finishes her salad she is still hungry so she orders pie for dessert for 4.75. Next, for each of the four Tab objects print out the member's name, the seat number, and the current total amount owing. Suppose Mike wishes to leave a 20% tip. Sarah, feeling slightly less generous, wishes to leave an 18% tip. Jin and Ella both opt to leave 16% tips. Make the appropriate method calls to retrieve the tip amounts for each patron. Print out each of these tip amounts. (Aside: You do NOT need to worry about displaying the tip amounts with exactly 2 decimal digits.) NOTE: In this driver program, be sure to label all of your output so the meanings of the values are clear. (i.e. Don't just print out numbers without explaining what they represent.) You do NOT need to worry about displaying the monetary amounts with exactly 2 decimal digits

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

Step: 3

blur-text-image

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

Question

Describe the criteria for an effective budget.

Answered: 1 week ago