Question

Cdiculated. Program 4: Many states base yearly car registration fees on an automobiles model year and weight, using a schedu
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

Program

#include <iostream>

using namespace std;

int main()

{

int Year, weight; //initializing the variables

cout<<"Enter the automobile's Year : ";

cin>>Year; //Reads the input from the user

cout<<"Enter the weight : ";

cin>>weight;

if(Year<=1990)

{

if(weight<2700)

{

cout<<"weight class is : "<<1<<endl;;

cout<<"Registration Fee is : "<<26.50<<endl;;

}

if(weight>=2700 && weight<=3800)

{

cout<<"weight class is : "<<2<<endl;;

cout<<"Registration Fee is : "<<35.50<<endl;;

}

if(weight>3800)

{

cout<<"weight class is : "<<3<<endl;;

cout<<"Registration Fee is : "<<56.50<<endl;;

}

}

if(Year>=1991 && Year<=1999)

{

if(weight<2700)

{

cout<<"weight class is : "<<4<<endl;;

cout<<"Registration Fee is : "<<35.00<<endl;;

}

if(weight>=2700 && weight<=3800)

{

cout<<"weight class is : "<<5<<endl;;

cout<<"Registration Fee is : "<<45.50<<endl;;

}

if(weight>3800)

{

cout<<"weight class is : "<<6<<endl;;

cout<<"Registration Fee is : "<<62.50<<endl;;

}

}

if(Year>=2000)

{

if(weight<3500)

{

cout<<"weight class is : "<<7<<endl;;

cout<<"Registration Fee is : "<<49.50<<endl;;

}

if(weight>=3500)

{

cout<<"weight class is : "<<8<<endl;;

cout<<"Registration Fee is : "<<62.50<<endl;;

}

}

}

Output:

} clang++-7 pthread -std=c++17 -o main main.cpp } ./main Enter the automobiles Year : 1800 Enter the weight : 2600+ weight c

} clang++-7 pthread -std=c++17 -o main main.cpp } ./main Enter the automobiles Year : 1995 Enter the weight : 3000 weight cl

> clang++-7 pthread -std=c++17 -o main main.cpp }./main Enter the automobiles Year : 2020 Enter the weight : 3400 weight cla

Add a comment
Know the answer?
Add Answer to:
Cdiculated. Program 4: Many states base yearly car registration fees on an automobile's model year and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT