Your city's Parking Violation Bureau 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 fine of $20, type C carries a fine of $30, and type D carries a fine of $50. The program should ask for a number of type A violations, the number of type B violations, and so on. If the number of type A, B, or C violations exceeds 10, impose an additional fine of $50 for each category that exceeds 10. If the total number of type A,B, or C exceeds 20 but none of types A,B or C individually exceeds 10, impose an additional fine of $75. If the number of type D violations exceeds three, impose an additional fine of $20 for each type D violation over three. The program should display the total fine for the person. The program should process any number of persons.

I'm just a beginner. Please help me with the Input using TC3. I didn't start it yet.

#include<iostream.h>

#include<conio.h>
void main()
{
clrscr();
int fineA=10,fineB=20,fineC=30,fineD=50;
int ABC,result,result1,total;
int typeA,typeB,typeC,typeD;
int totalfineA,totalfineB,totalfineC,totalfineD;
char q;
do
{
cout<<"Enter total number of A violations: ";
cin>>typeA;
if(typeA>10)
totalfineA=(typeA*fineA+50);
else
totalfineA=(typeA*fineA);
cout<<"Enter total number of B violations: ";
cin>>typeB;
if(typeB>10)
totalfineB = (typeB*fineB+50);
else
totalfineB = (typeB*fineB);
cout<<"Enter total number of C violations: ";
cin>>typeC;
if(typeC>10)
totalfineC = (typeC*fineC+50);
else
totalfineC = (typeC*fineC);
result1=(totalfineA+totalfineB+totalfineC);
ABC=(typeA+typeB+typeC);
if ( ABC>20 )
{
result=result1;
if (typeA<10)
{
result=result1;
if (typeB<10)
{
result=result1;
if (typeC<10)
{
result=(result1+75);
}
else
{
result=result1;
}
}
else
{
result=result1;
}
}
else
{
result=result1;
}
}
else
{
result=result1;
}
cout<<"Enter total number of D violations: ";
cin>>typeD;
if ( typeD>3 )
totalfineD=(typeD*fineD)+(typeD*20);
else
totalfineD=(typeD*fineD);
total = (result+totalfineD);
cout<<"\n";
cout<<"The total fine is: $"<<total<<endl;
cout<<"\n\nDo you want to process another person ? (Y or N): ";
cin>>q;
cout<<"\n";
}
while(q!='N'&&q!='n');
cout<<"Press enter to quit the program!!!";
getch();
}

Sure! Let's break down the problem and guide you on how to approach it.

To solve this problem, you'll need to write a program that takes input for the number of each type of violation and calculates the total fine based on specific conditions. Here's how you can approach it:

1. Begin by defining your variables. You'll need variables to store the number of violations for each type (A, B, C, and D), as well as variables to keep track of any additional fines imposed.

2. Ask the user for input. In this case, you'll need to prompt the user to enter the number of type A, B, C, and D violations. For example, you can use the following Python code to get input:

```python
num_a = int(input("Enter the number of type A violations: "))
num_b = int(input("Enter the number of type B violations: "))
num_c = int(input("Enter the number of type C violations: "))
num_d = int(input("Enter the number of type D violations: "))
```

3. Calculate the fines. Start by initializing a variable `total_fine` with a value of 0. Then, apply the given conditions to calculate the fines:

```python
total_fine = 0

# Check if type A violations exceed 10
if num_a > 10:
total_fine += 50

# Check if type B violations exceed 10
if num_b > 10:
total_fine += 50

# Check if type C violations exceed 10
if num_c > 10:
total_fine += 50

# Check if total of type A, B, C exceed 20 but individually none of them exceed 10
if (num_a + num_b + num_c) > 20 and num_a <= 10 and num_b <= 10 and num_c <= 10:
total_fine += 75

# Check if type D violations exceed 3
if num_d > 3:
total_fine += (num_d - 3) * 20
```

4. Display the total fine. You can use the following code to output the calculated total fine:

```python
print("Total fine: $", total_fine)
```

By following these steps, you should be able to write a program that calculates fines for parking violations based on the given conditions. Remember to handle multiple persons if required.

I hope this helps you get started on solving the problem! Let me know if you have any further questions.