Pesign a Tips class that calculates the gratuity on a restaurant meal. Its only class member variable, taxRate should be set by a one parameter constructor to whatever rate is passed to it when a Tip object is created. If no argument is passed, a default tax rate of .085 should be used. You may use a default constructor for the default value. taxRate should be Private. The class should have just one public function, computeTip, This function needs to accept two arguments, the total bill amount and the tip rate. It should use the total bill amount, along with the value stored in the taxRate member variable to compute the cost of the meal before the tax was added. It should then apply the tip rate to just the meal cost portion of the bill to compute and returr the tip ammounts. Demonstrate the class by creating a program that creates a single Tips object, and then loops to let the user retrieve the correct tip amount using various bill totals and desired tip rates. Validation: The tax rate entered by the user should be validated to ensure that it is greater than or equal to zero. Sample Output: NIS program wi Compute a restaurant tip based on a total bill amount and the % the patron wishes to tip the server. Tax for this location: -3 Tax x cannot be less than o. Please re-enter tax x: 6 ...**.* Tip Helper*** Enter total bill amount: 25.00 Enter desired tip x 20 The tip should be S 4.72 compute another ti p Cy/n)? y *** Tip Helper ** Enter total bil1 amount: 10.43 Enter desired tiP X 15 The tip should be S 1.48 Compute another tip (y/n)? n Your programs should conform to the Programming Style Requirements as listed in Blackboard. In

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

It not complex please don't reject it. give code of it. Wrong answer downvote sure

Pesign a Tips class that calculates the gratuity on a restaurant meal. Its only class member variable,
taxRate should be set by a one parameter constructor to whatever rate is passed to it when a Tips
object is created. If no argument is passed, a default tax rate of .085 should be used. You may use a
default constructor for the default value. taxRate should be Private
The class should have just one public function, computeTip, This function needs to accept two
arguments, the total bill amount and the tip rate. It shoulduSe the total bill armount, along vwith the
value stored in the taxRate member variable to compute the cost of the meal before the tax was
added. It should then apply the tip rate to just the meal cost portion of the bill to compute and return
the tip amnounts.
Demonstrate the class by creating a program that creates a single Tips object, and then lops to let
the user retrieve the correct tip amount using various bill totals and desired tip rates.
Validation: The tax rate entered by the user should be validated to ensure that it is greater than or
equal to zero
Sample Output:
nis program wilT Compute a restaurant tip based ona total
bill amount and the % the patron wishes to tip the server.
Tax % for this location: -3
Tax X cannot be less than o. Please re-enter tax X: 6
TiP Helper
Enter total bill amount: 25.00
Enter desired tip X 20
The tip should be S 4.72
Compute another tip (y/n)? y
w Tip Helper**
Enter total bill amount: 10.43
Enter desired tip % 15
The tip should be S1.48
Compute another tip (y/n)? n
Your programs should conform to the Programming Style Requirements as listed in Blackboard. In
addition, all output should be labeled appropriately (Ex. Number of slices are po). Turn in your source
CCRD) file(s) to Blackboard (be sure to attach all files before pressing SUBMIT).
Transcribed Image Text:Pesign a Tips class that calculates the gratuity on a restaurant meal. Its only class member variable, taxRate should be set by a one parameter constructor to whatever rate is passed to it when a Tips object is created. If no argument is passed, a default tax rate of .085 should be used. You may use a default constructor for the default value. taxRate should be Private The class should have just one public function, computeTip, This function needs to accept two arguments, the total bill amount and the tip rate. It shoulduSe the total bill armount, along vwith the value stored in the taxRate member variable to compute the cost of the meal before the tax was added. It should then apply the tip rate to just the meal cost portion of the bill to compute and return the tip amnounts. Demonstrate the class by creating a program that creates a single Tips object, and then lops to let the user retrieve the correct tip amount using various bill totals and desired tip rates. Validation: The tax rate entered by the user should be validated to ensure that it is greater than or equal to zero Sample Output: nis program wilT Compute a restaurant tip based ona total bill amount and the % the patron wishes to tip the server. Tax % for this location: -3 Tax X cannot be less than o. Please re-enter tax X: 6 TiP Helper Enter total bill amount: 25.00 Enter desired tip X 20 The tip should be S 4.72 Compute another tip (y/n)? y w Tip Helper** Enter total bill amount: 10.43 Enter desired tip % 15 The tip should be S1.48 Compute another tip (y/n)? n Your programs should conform to the Programming Style Requirements as listed in Blackboard. In addition, all output should be labeled appropriately (Ex. Number of slices are po). Turn in your source CCRD) file(s) to Blackboard (be sure to attach all files before pressing SUBMIT).
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY