违反交通法规的Challan(fine)计算器 [英] Challan (fine)Calculator for Traffic Violation

查看:83
本文介绍了违反交通法规的Challan(fine)计算器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写一个程序来计算交通违章的挑战.基本思想是,用户将输入违规的类型以及直到挑战日期为止的天数.挑战计算器将根据违规类型和天数来计算挑战.

详细说明:

我必须从用户那里获取交通违规类型的输入.
如果违规类型为用于破坏交通信号灯",则用户将输入"1"
如果违规类型为超速驾驶",则用户将输入"2"
如果违规类型为不系安全带",则用户将输入"3"
如果用户输入除1、2或3以外的其他任何数字,程序将打印一条消息输入有效的交通违规类型".
打印后,此消息程序将从头开始重新启动,并提示用户输入有效的交通违规类型.
如果用户输入"1",则罚款额为500卢比;如果输入"2",则罚款额为300卢比;如果用户输入"3",则罚款额为200卢比.

现在,程序将提示用户输入截止到挑战日期的天数.
如果天数小于或等于10,则总挑战将与罚款金额相同.
如果天数大于10或小于/等于30天,则总挑战将为罚款额的两倍.
如果天数超过30天,则将罚款的50%加倍.即罚款2倍+罚款1/2倍.

在向用户显示总挑战后,程序应询问用户是否要计算另一个挑战.用户可以输入"y"或"n"作为是或否的选择.程序将同时处理大小写的用户选择.

如果用户输入"y"或"Y",则程序应清除屏幕并再次开始整个过程​​,否则请终止程序.
我应该写什么代码才能获得这些结果.

解决方案

请阅读 [ ^ ]


您应该尝试自己做作业.
请注意,这是一个非常简单的任务,如果您最终不会成功,那么您将是一个出色的项目经理.


而不是发布家庭作业问题,发布哪些内容您尝试解决的所有问题.然后问有关的问题.希望没人能免费做功课.


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.

解决方案

please read this[^]


You should try yourself to do your own homework.
Please note this is a very simple task, if you won''t eventually succeed, then you''ll could be a great Project Manager.


Rather posting home work questions, post what are all the things you tried to solve it. And then ask the regarding questions. I hope nobody will do your homework for free.


这篇关于违反交通法规的Challan(fine)计算器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆