Answer to Question #264449 in C++ for sasan

Question #264449

Based on the given main menu create a program that will compute the Total Fine 

                    ----  Violation Code and Penalties -----

053 - Disobedience to traffic control signals/signs - 350 pesos

054 - Driving tricycle on national road - 350 pesos

055 - Driving without license - 700 pesos

056 - Discrimination of passengers/trip cutting - 700 pesos


        ---- Offense Code ----

1 - First Offense

2 - second Offense

3 - Third Offense


Enter Code:

Enter Offense Code:



For the first offense, there is no extra penalty; for the second offense, there is a 5% additional penalty based on the existing penalty; and for the third offense, there is a 10% additional penalty based on the existing penalty. The 12% Tax is also included in the computation of the Total Fine.



1
Expert's answer
2021-11-11T17:36:19-0500
#include<iostream>
using namespace std;
int main()
{
	int c,offense,penalty;
	cout<<"             ----  Violation Code and Penalties -----\n053 - Disobedience to traffic control signals/signs - 350 pesos\n054 - Driving tricycle on national road - 350 pesos\n055 - Driving without license - 700 pesos\n056 - Discrimination of passengers/trip cutting - 700 pesos";
    cout<<"\n\n            ---- Offense Code ----\n1 - First Offense\n2 - second Offense\n3 - Third Offense\n";
	cout<<"\nEnter the code: ";
	cin>>c;
	cout<<"\nEnter the offense code: ";
	cin>>offense;
     if(c==53&&offense==1){
     	cout<<"The total fine is: 350penos";
     	
	 }
	 else if(c==53 && offense==2){
	 	penalty=350+(350*5/100);
	 	cout<<"The total fine is: "<<penalty;
	 }
	 else if(c==53 && offense==3){
	 	penalty=350+(350*12/100);
	 	cout<<"The total fine is: "<<penalty;
	 }
	  else if(c==54 && offense==1){
     	cout<<"The total fine is: 350penos";
	 }
	 else if(c==54 && offense==2){
	 	penalty=350+(350*5/100);
	 	cout<<"The total fine is: "<<penalty;
	 }
	 else if(c==54 && offense==3){
	 	penalty=350+(350*12/100);
	 	cout<<"The total fine is: "<<penalty;
	 }
	  else if(c==55 && offense==1||c==56 && offense==1){
     	cout<<"The total fine is: 700penos";
	 }
	 else if(c==55 && offense==2||c==56 && offense==2){
	 	penalty=700+(700*5/100);
	 	cout<<"The total fine is: "<<penalty;
	 }
	 else if(c==55 && offense==3||c==56 && offense==3){
	 	penalty=700+(700*12/100);
	 	cout<<"The total fine is: "<<penalty;
	 }
	 
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS