Write a program to input the distance covered and calculate the amount paid by the passenger the program displays the printed bil with taxinumber diatance covered amount
Answers
Answer:
import java.io.*;
class calc
{
public static void main( String args[] ) throwsIOException
{
BufferedReader in = new BufferedReader ( System.in) ;
System . out . println ( " Enter the distance " );
int distance = Integer . parseInt ( in . readLine ( ) ) ;
System . out . println ( " Enter the rate " ) ;
int rate = Integer . parseInt ( in . readLine ( ) );
System . out . println ( " Enter the taxi number " ) ;
int taxino = Integer . parseInt ( in . readLine ( ) );
int amt = ( distance * rate ) ;
System . out . println ( " Amount to be paid = " + amt) ;
System . out . println ( " distance = " + distance ) ;
System . out . println ( " taxinumber = " + taxino ) ;
}
}