what should i do to make a program like these

Can you please help me make a c++ program that would ask if how many bills and compute its total, and then ask how many coins you have, and then, also compute its total. i really need help. sorry guys i'm a beginner
What is there to compute if it asks the user and the user tells them the number?
This solution for my understanding of your topic.
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
//start
#include<iostream>
using namespace std;
int main(){
	int bills;
	int coins;
	int choice;
	int totalBills=0;
	int totalCoins=0;
	cout<<"What do you want to total(2 for Coins AND any number for Bills):"<<endl;
    cin>>choice;
	if (choice==2){
		do{
			cout<<"Your coins?[-1 to finish]"<<endl;
			cin>>coins;
			totalCoins=totalCoins+coins;
			cout<<"Total:"<< totalCoins<<endl;
		
	}while(coins!=-1);
	}
	else
	{
	do{
			cout<<"Your Bills?[-1 to finish]"<<endl;
			cin>>bills;
			totalBills=totalBills+bills;
			cout<<"Total:"<< totalBills<<endl;
		
	}while(bills!=-1);
	}
	return 0;
}
//End 
Last edited on
Topic archived. No new replies allowed.