Cell Phone Usage Charges Project

Is this how I should start my project???

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/ /   [ Y o u r  Name ( s ) ]
/ /   CPSC  1 2 0
/ /   P r o j e c t   # 1
/ /   Due   [ Due   D a t e ]

# i n c l u d e  <i o s t r e a m >
 u s i n g   namespace    s t d ;
 i n t   main    (   )
{
   string username; 
   float monthly rate= 29.99
   float overage minute= 0.05
   float overage text = 0.07 
   float tax rate= 7.75% 

  cout << "The number of overage minutes"; 
  cin >> overage minutes; 

r e t u r n   0 ;
}



In this lab you will write a C++ program that calculates usage charges for a subscriber ’s cell phone bill.

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%


What to do

Use the following as a starting point for your code:

/ / [ Y o u r Name ( s ) ]
/ / CPSC 1 2 0
/ / P r o j e c t # 1
/ / Due [ Due D a t e ]
# i n c l u d e <i o s t r e a m >
u s i n g namespace s t d ;
i n t main ( )
{
/ / a d d c o d e h e r e
r e t u r n 0 ;
}


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



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


You are free to use whatever wording you’d like, as long as it is clear and descriptive. However, the numeric output of your program should match the above examples. It is OK if our figures disagree by one or two cents, since floating point arithmetic is subject to small rounding errors.
Last edited on
You should start with what your professor provided.

1
2
3
4
5
6
7
8
9
10
11
//[Your Name(s)]
//CPSC120
//Project #1
//Due[DueDate]
#include <iostream>
using namespace std; //questionable
int main()
{
    //add code here
    return 0;
}



Then you may ask a question instead of posting a homework assignment.
http://www.cplusplus.com/forum/beginner/1/
Topic archived. No new replies allowed.