I need help with this program. I do not even know where to begin. Can somebody please help me figure out how to start the program, anything helps
Your city's parking bureau wants you to write a program to compute fines for parking violations. There are four types of violation: type A carries a fine of $10, type B carries a fine of $20, type C carries a fine of $30, and type D carries a fine of $50. The program should ask for the number of type A violations, the number of type B violations, and so on. The program should display the total fine for the person.
1
Expert's answer
2012-07-24T11:45:23-0400
#include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int sum=0; int buf=0; cout<<"Enter number of A violations:\n"; cin>>buf; sum=sum+buf*10; cout<<"Enter number of B violations:\n"; cin>>buf; sum=sum+buf*20; cout<<"Enter number of C violations:\n"; cin>>buf; sum=sum+buf*30; cout<<"Enter number of D violations:\n"; cin>>buf; sum=sum+buf*50; cout<<"Total fine is "<<sum<<" "; return 0; }
Comments
Leave a comment