Question: In java please 1 . Use your own methods. 2 . Minimize the main ( ) as much as possible. ` ` ` import java.util.Scanner;
In java please
Use your own methods.
Minimize the main as much as possible.
import java.util.Scanner;
public class Jmp
public static void mainString args
Scanner scanner new ScannerSystemin;
double totalReceipts ;
loop continuosly get input from hours parked
while true
System.out.printlnEnter hours parked or to end:;
int hoursParked scanner.nextInt;
If the input is end the loop
if hoursParked
break;
function to print out charge for customers
double charge calculateChargehoursParked;
totalReceipts charge;
prints a float in two decimal places
System.out.printfCharge for current customer: $f
charge;
System.out.printfTotal receipts for yesterday: $f
totalReceipts;
scanner.close;
calculate the amount of money charged per hour
public static double calculateChargeint hours
double charge ; Minimum charge for up to hours
if hours
charge hours ;
if charge
charge ; Maximum charge for hours
return charge;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
