i want ot write a program for calculating challan for traffic violations. The basic idea is that user will enter the type of violation and number of days passed till date of challan. The challan calculator will calculate the challan based upon the type of violation and number of days.
Detailed Description:
i are required to take input from user for type of traffic violation.
User will enter ‘1’ if the violation type is “For breaking traffic signal”
User will enter ‘2’ if the violation type is “For over speeding”
User will enter ‘3’ if the violation type is “For not wearing seat belt”
If user enters any other number except 1, 2 or 3, the program will print a message “Enter a valid type of traffic violation”.
After printing this message program will start again from beginning and prompt user to enter the valid type of traffic violation.
If user enters ‘1’ the amount of fine is Rs.500, if ‘2’ then Rs.300 and if user enters ‘3’ then fine will be Rs.200.
Now, program will prompt user to enter number of days passed till challan date.
If number of days are less than or equal to 10, then the total challan will be same as amount of fine.
If number of days are more than 10 or less than/equal to 30, then total challan will be double of amount of fine.
If number of days are more than 30, then 50% of fine will be added in double of amount of fine. i.e. 2 times fine + 1/2 times fine.
After displaying the total challan to user, the program should ask if the user wants to calculate another challan. The user can enter ‘y’ or ‘n’ as choices for yes or no. Program will handle user’s choice in both upper and lower cases.
If the user enters ‘y’ or ‘Y’, then program should clear the screen and start the whole process again or terminate the program otherwise.
what codes should i write to take these results.