So I'm a new member here and i don't know how to make things coding for the amount of total claim for the question.
Here is what i got so far
Code:
#include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
int main(int argc, char*argv)
{
char clas,response;
int dista;
float amount, rate;
printf("Enter Class of Vehicle: ");
scanf("%c",&clas);
Label1:
printf("Enter Distance Travelled(km):");
scanf("%d",&dista);
switch(clas)
{
case'A':
case'a':rate = 0.70;break;
case'B':
case'b':rate = 0.60;break;
case'C':
case'c':rate = 0.50;break;
case'D':
case'd':rate = 0.45;break;
default:printf("Wrong Input");rate=0;
}
amount = rate*dista;
printf("\n Amount of Claim 1 (RM): %.2f",amount);
printf("\n Next mileage Claim(EnterY/N):");
if(response 'Y')
{
goto Label2;
}
else(response 'N')
{
printf("End");
}
}
Label2:
printf("\n Enter Distance Travelled(km): ");
scanf("%d",&dista);
switch(clas)
{
case'A':
case'a':rate = 0.70;break;
case'B':
case'b':rate = 0.60;break;
case'C':
case'c':rate = 0.50;break;
case'D':
case'd':rate = 0.45;break;
default:printf("Wrong Input");rate=0;
}
amount = Label1 + Label2;
printf("Total Amount of Claim: %.2f",amount);
return(0);
What should i do to make it work? I've been trying to solve this for a few weeks now 
Or I tried this one out but still stuck. Which method is better for having total amount of claim?
Code:
#include<stdio.h>
int main()
{
char clas, next, response, Y, N;
int i, dista;
float amount1,amount2, rate, grandtotal;
printf("Enter Class of Vehicle: ");
scanf("%c", &clas);
printf("Enter Distance Travelled(km):");
scanf("%d", &dista);
switch(clas)
{
case'A':
case'a':rate = 0.70;break;
case'B':
case'b':rate = 0.60;break;
case'C':
case'c':rate = 0.50;break;
case'D':
case'd':rate = 0.45;break;
default:printf("Wrong Input");rate=0;
}
amount1 = rate*dista;
printf("\n Amount of Claim 1 (RM): %.2f",amount1);
i++;
printf("\n Next Mileage Claim (Enter Y/N)");
scanf("%c",&next);
if(response == Y);
{
printf("\n Enter Distance Travelled(km):");
scanf("%d", &dista);
}
if else(response == N);
{
printf("End");
}
amount2 = rate*dista;
printf("\n Amount of Claim 2 (RM): %.2f",amount2);
//This is the total amount i'm trying to make
grandtotal = amount1 + amount2;
printf("Total Amount of Claim = %.2f",grandtotal);
return(0);
}