According to the question there will be two required variables for storing the values ,the one is age of the person and second is the fare of the person.
Age should be of integer type and Fare can be of float type.
I'm writing this on C language for better understanding for the user.
#include <stdio.h>
main()
{
int age;
float fare=1000; // fare can be anything ..
printf("Enter your age:\n"); // asking age of the person
scanf("%d",&age); //taking person age as an input
if(age<14){ // checking condition using if statement
fare=(fare-(fare/2)); // performing operation on the fare according to the question
printf("Your fare is :%f",fare); // printing the calculated fare after the operation
}
else if(age>14 && age<50){ // checking another condition
fare=(fare-(fare/10)); // performing operation on the fare according to the question
printf("Your fare is :%f",fare); //printing the calculated fare after the operation
}
else{
fare=(fare-(fare/5)); //performing operation on the fare according to the question
printf("Your fare is :%f",fare); //printing the calculated fare after the operation
}
} // closing the main function.