Please answer it correct(JAVA PROGRAM)
Attachments:
Answers
Answered by
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
Science,
4 months ago
Science,
4 months ago
Math,
8 months ago
Science,
8 months ago
Political Science,
11 months ago