Cell Phone Project

Hello all,

I'm just starting to learn C++ and am having difficulty on a project. I've got some of it figured out, but now need help with the calculations to output the phone bill total, then amount received by customer in pennies. I basically need to it display as the sample output listed below. Any help is appreciated, thank you!

Sample Output:

Enter the name of the customer: Larry Smith
Enter street address: 122 Main Street
Enter city: Charlotte
Enter state: NC
Enter zip code: 23499
Enter the number of minutes used: 157

Larry Smith
122 Main Street
Charlotte, NC 23499
Amount Owed: $31.40

Enter the amount received from customer: 5000

Denomination Number
-------------- ---------------
Dollars 18
Quarters 2
Dimes 1
Nickels 0
Pennies 0


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
37
38
39
40
41
42
43
#include<iostream>
#include<string>
using namespace std;

int main()
{
	string name, street, city, state;
	int zip, minutes;

	
	cout << "Enter the name of the customer: ";
	getline(cin, name);
	
	
	cout << "Enter Street Address: ";
	getline(cin, street);
		
	cout << "Enter city: ";
	cin >> city;
	
	cin.ignore(INT_MAX, '\n');
	
	cout << "Enter state: ";
	cin >> state;

	cin.ignore(INT_MAX, '\n');

	cout << "Enter zip code: ";
	cin >> zip;
	
	cout << "Enter the number of Minutes used: ";
	cin >> minutes;
	
	cout << name << endl; 
	cout << street <<endl; 
	cout << (city, state) << endl; // need help displaying city, state next to each other
	cout << zip << endl; 
	cout << minutes << endl;
	
	
	
	return 0;
}
Last edited on
Could you post all of your code you have so far? We would have to write it all if we were given just this.
theturk1234, as i'm just learning, this is what I have so far which displays the name, street, city, state and zip and minutes used but I need help with having it display:

Amount Owed: $31.40 (after typing in 157 minutes used)

Enter the amount received from customer: 5000

Denomination Number
-------------- ---------------
Dollars 18
Quarters 2
Dimes 1
Nickels 0
Pennies 0
You haven't mentioned the cost-plan per minute......

HINT:
calculation part may need a modulus function %
Topic archived. No new replies allowed.