Write java program to accept vehicle number and number of hours the vehicle is parked in the parking lot. Calculate the bill amount if the parking charge per hour is Rs5.
Answers
Answered by
6
Answer:
Explanation:
import java.util.Scanner;
class vehicle
{
public static void main(String[]args)
{
Scanner in = new Scanner(System.in);
System.out.println("Enter the vehicle number");
int v_no = in.nextInt();
System.out.println("Enter the total no.of hours the vehicle was parked");
int hours = in.nextInt();
double amt;
amt = hours * 5;
System.out.println("Total amt to be paid: " + amt);
}
}
Similar questions