Computer Science, asked by syedahmedusman1, 8 months ago

Please answer it correct(JAVA PROGRAM)

Attachments:

Answers

Answered by Anonymous
1

import java.util.Scanner;

class taxi

{

public static void main(String args[])

{

Scanner sc= newScanner (System.in);

System.out.println("enter the taxi no.");

int t = sc.nextInt();

System.out.println("enter the distance travelled");

int d=sc.nextInt();

int a = 0;

if(d<= 10)

{

a=a+25;

}

else if(11<=d<=30)

{

a=a+10;

}

else if(31<=d<=70)

{

a=a+15

}

else

{

a=a+12;

}

System.out.println(t);

System.out.println(d);

System.out.println(a);

}

}

Similar questions