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
Computer Science,
4 months ago
Hindi,
4 months ago
Math,
9 months ago
Science,
9 months ago
Political Science,
1 year ago