Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You're to write a c++ program that calculates a dental bill. The first thing your program will have to do is ask if the patient

You're to write a c++ program that calculates a dental bill. The first thing your program will have to do is ask if the patient is a member or non-member of a dental plan.

If the patient is a member, you should then prompt the user for an account number. This number will be forwarded to the GetCopayment function, which will examine the account number and to return the correct copayment value. How will GetCopayment determine what to do with the account number? Well, first of all the account number is limited to a six-digit number; so anything other than a six-digit number means an invalid account number has been provided, and in this case GetCopayment should return an invalid value so the caller will know about it (a return value of negative one should work). Otherwise the GetCopayment function will return $15.00 if the account number is between 100000 and 399999, $10.00 if the account number is between 400000 and 699999, and $5.00 if the account number is between 700000 and 999999. If the caller receives an invalid value from GetCopayment, an error message should be displayed indicating that the patient appears to have a problem with their account. Else, the user will then be prompted for the amount for additional services.

The additional services charge and the copayment amount will be passed to the CalcTotal function, which will add the two values together. But before returning the result to the caller, it is first discounted by 8% (after all, this is a member's bill, so they've got to get some benefit, right?).

But what if the user indicates that the patient is not a member of the dental plan? Then the user will be prompted to enter charges for the X-rays, cleaning and any extra; charges. These values will be passed to the CalcTotal function so that their sum will be calculated and returned to the caller, but not before adding a 12% surcharge!

In case you haven't noticed yet, this program will contain two functions called CalcTotal. But there's no problem with that because you'll be overloading the functions

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions