Veihcle

jskjshkjs
 avatar
unknown
c_cpp
3 years ago
920 B
0
Indexable
#include<stdio.h>
int main()
{


    int speed;
    char prev_ticket;


    printf("Enter your speed : ");
    scanf("%d",&speed);
    printf("Any previous speeding ticket?\n");
    scanf("%c",&prev_ticket);


    if ( speed <= 100 && ( prev_ticket== 'Y' || prev_ticket== 'N' ))
    {
        printf("Your Fine amount is  : 0 Dollar ");
    }
    else if(speed >= 101  &&  speed <= 120)
    {
        if ( prev_ticket== 'N' )
        {
            printf("Your Fine amount is  : 50 Dollar");
        }
        else{
            printf("Your Fine amount is  : 150 Dollar");
        }
    }
    else if (speed > 120)
    {
        if( prev_ticket=='N' ){
            printf("Your Fine amount is  : 80 Dollar");
        }
        else{
            printf("Your Fine amount is  : 150 Dollar");
        }
    }
    else{
        printf("Invalid Input");
    }


    return 0;

}