Need HELP with Cell Phone Usage Charges C++ assignment

Am I doing everything right for this project?
I'm not sure what to do after writing down the calculations.
I don't think I'm doing the subtotal part correctly on the last line.
I still have more to do but not sure what to do.

This is the prompt:
As you probably know, cellular phone plans typically give users a fixed al- lowance of minutes and texts, then charge for every minute or text beyond the allowances. You will write a C++ program that takes the number of overage minutes and overage texts, and outputs a subtotal, tax, and total bill for the user.

You can assume the user ’s billing plan works as follows:


• the base monthly rate is $39.99

• each overage minute costs $0.05

• each overage text costs $0.07

• the tax rate is 7.75%


Fill in all the fields between square brackets (e.g. [Due Date]) with the appropriate information. This code should build without any errors.

You need to add code to perform the following steps:


• Ask the user for the number of overage minutes.

• Ask the user for the number of overage texts.

• Calculate and print the user ’s subtotal, using the following formula: Subtotal = 39.99+((minutes over) * .05) + ((texts over)* .07)
• Calculate and print the user ’s sales tax, using the following formula: Sales Tax = (Subtotal) × .0775
• Calculate and print the user ’s total bill, using the following formula: Total = (Subtotal) + (Sales Tax)

You can assume that the user will never enter a negative number. You may treat the dollar amounts as dollars stored as floating point numbers.


Sample input and output

I Need to get it like this:
The following are examples of correct input and output:

M i n u t e s o v e r : 0
T e x t s o v e r : 0
S u b t o t a l : 3 9 . 9 9
Tax : 3 . 0 9 9 2 3
T o t a l : 4 3 . 0 8 9 2


M i n u t e s o v e r : 6
T e x t s o v e r : 0
S u b t o t a l : 4 0 . 2 9
Tax : 3 . 1 2 2 4 8
T o t a l : 4 3 . 4 1 2 5


M i n u t e s o v e r : 3
T e x t s o v e r : 1 1
S u b t o t a l : 4 0 . 9 1
Tax : 3 . 1 7 0 5 3
T o t a l : 4 4 . 0 8 0 5

So far I have this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
// CPSC 120 
// Project #1
// Due February 27, 2014

#include <iostream> 
using namespace std; 
int main() 
{
	string username; 
	double monthlyRate = 39.99;
	double overageMinute = 0.00;
	double overageText = 0.00;
	double taxRate = 0.0775; 
	double salesTax = 0; 
	double subtotal = 0; 
	double Total = 0; 

	cout << "How many minutes are you over the monthly? " << endl; 
	cin >> overageMinute; 

	cout << "How many texts are you over for this month? " << endl; 
	cin >> overageText; 

	subtotal = monthlyRate + ((overageMinute*.05) + (overageText*.07)); 

	salesTax = (subtotal)*taxRate; 

	Total = (subtotal)+(salesTax);

	cout << "What is the" << subtotal << " at 39.99" << endl; 
	cin >> subtotal;

	system("pause");
	return 0;
}



Last edited on
I just gave you an example in your original thread - we may have been posting at the same time.

No need to start a new thread :)
Topic archived. No new replies allowed.