60 414
Assignments Done
Successfully Done
In April 2018

Answer to Question #59160 in C# for Lekorius Wallace

Question #59160
Your city’s Parking Violation Bu-reau wants you to write a program to compute fines for parking violations. There are four types of violation: type A carries a fine of $10, type B carries a fine of $20, type C carries a fine of $30, and type D carries a fine of $50. The program should ask for the name of offender, the number of type A violations, the number of type B violations, and so on. Store the offender’s name in a string object. The program should display the offender’s name and the total fine for the person.
Expert's answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
class Program
static void Main(string[] args)
string name;
int A, B, C, D;
Console.WriteLine("Enter the name of offender");
name = Convert.ToString(Console.ReadLine());
Console.WriteLine("Enter number of each type of violation");
Console.Write("Type A : ");
A = int.Parse(Console.ReadLine());
Console.Write("Type B : ");
B = int.Parse(Console.ReadLine());
Console.Write("Type C : ");
C = int.Parse(Console.ReadLine());
Console.Write("Type D : ");
D = int.Parse(Console.ReadLine());
Console.WriteLine("The name is total fine");
int total = A * 10 + B * 20 + C * 30 + D * 40;
Console.WriteLine(name + " " + total+"$");


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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions