How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask ATLProg Your Own Question

ATLProg
ATLProg, Software Engineer
Category: Homework
Satisfied Customers: 9151
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
44910485
Type Your Homework Question Here...
ATLProg is online now
A new question is answered every 9 seconds

Students will write an application to calculate speeding ticket

This answer was rated:

Students will write an application to calculate speeding ticket fines for any number infractions. For each ticket, the input to this program will be the following (1) actual speed, (2) speed limit, (3) whether the offense occurred in a work zone, in a residential district, or not and (4) the court fees. The court fees are the same through the run, it is asked to the user only once. The output should show the total amount for the ticket. Once one total fine has been computed, the user should be given the choice of processing another ticket or quit.


Speeding
Fine: $5 per mile over speed limit plus Court Fees

Speeding Highway Work Zone
Fine: $6 per mile over speed limit plus Court Fees

Speeding in a Residential District
Fine: $7 per mile over speed limit plus $200 plus Court Fees


Here is a typical session for this program:
Enter court fees: 62
Enter the type of speeding offense (1 for regular, 2 for highway, 3 for residential): 1
Enter the speed limit: 25
Enter the vehicle speed: 35
The total fine is $112

Enter 1 to enter another ticket or 0 to quit this fine calculator: 1

Enter the type of speeding offense (1 for regular, 2 for highway, 3 for residential): 3
Enter the speed limit: 55
Enter the vehicle speed: 65
The total fine is $332

Enter 1 to enter another ticket or 0 to quit this fine calculator: 0
Good bye.

The program needs to be structured using a class named FineCalculator that is in charge of computing the fine. The class declaration follows:

class FineCalculator

{

public:

FineCalculator(int courtFees);

int getFine(int zone, int speedLimit, int actualSpeed) const;

private:

int _courtFees;

};

Thanks
Hello Welcome. Thank you for your question, I’m ATLProg and I’ll try to help you.

How soon do you need this answer ?
How soon do you need this answer ?
Customer: replied 3 years ago.

By today or tommorrow

THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
ATLProg and 5 other Homework Specialists are ready to help you