Here's is my C++ program exercise 4-12: Suppose that billingAmount is a double variable, which denotes the amount you need to pay to the department store. If you pay the full amount, you get $10.00 or...


Here's is my C++ program exercise 4-12:


Suppose that billingAmount is a

double variable, which denotes

the amount you need to pay to the

department store. If you pay the

full amount, you get $10.00 or 1%

of the billingAmount, whichever is

smaller, as a credit on your next

bill; If you pay at least 50% of the

billingAmount, the penalty is 5%

of the balance; If you pay at least

20% of the billingAmount and less

than 50% of the billingAmount,

the penalty is 10% of the balance;

otherwise the penalty is 20% of the

balance. Design an algorithm that

prompts the user to enter the

billing amount and the desired

payment. The algorithm then

calculates and outputs the credit or

the remaining balance. If the

amount is not paid in full, the

algorithm should also output the

penalty amount.


Now here's what I have so far:


#include
#include


using namespace std;


//declare constant variables




//define the main function
int main()
{
//declare the variables
double billingAmount;
double billingPayment;
double credit;
double penalty;
double balance;
double newBalance;


//Prompt the user to input the billing amount.
cout < "please="" enter="" the="" billing="" amount:="">
cin >> billingAmount;
cout <>


//Prompt the user to input the payment amount.
cout <"please enter="" the="" payment="" amount:="">
cin >> billingPayment;
cout <>


cout < fixed="">< showpoint=""><>
if (billingPayment == balance * 1.00)
credit = billingAmount * 0.01;
else if (credit >= 10.00)
credit = 10.00;
else if (billingPayment >= 0.50)
penalty = balance * 0.05;
else if (billingPayment >= 0.20 && billingPayment <>
penalty = balance * 0.10;
else
penalty = balance * 0.20;


newBalance = balance + penalty;


cout <"the penalty="" add="" to="" your="" next="" bill="" is:="" $"="">< penalty=""><>


cout <"the unpaid="" balance="" including="" the="" penalty="" is:="" $"="">< newbalance=""><>


return 0;
}


I suspect that I'm missing several constant variables, or I'm not using my declared variables correctly. Can someone help me smooth out the rough edges? Thanks!

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here