Hi I also want flowchart of this please Thank you Part 2 Sammy\'s Seashore Suppl
ID: 3706992 • Letter: H
Question
Hi I also want flowchart of this please Thank you Part 2 Sammy's Seashore Supplies rents beach equipment such as kayaks, canoes, beach chairs, and umbrellas to tourists. Write a program that prompts the user for the number of minutes he rented a piece of sports equipment. Compute the rental cost as $40 per hour plus $1 per addition minute. (you might have surmised already that this rate has a logical flaw, (correct it), then calculate the rates. Display Sammy's motto with the border that you created in the SammsMotto2 class in Part1. Then display the hours, minutes, and total price. Save the file as SammsRentalPrice.java.Explanation / Answer
SammsRentalPrice.java
import java.util.Scanner;
public class SammsRentalPrice {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the number of minutes: ");
int minutes = scan.nextInt();
int hours = minutes/60;
minutes = minutes%60;
int totalCost = hours*40 + minutes;
System.out.println("Hours: "+hours+" Minutes: "+minutes+" Total rent: "+totalCost);
}
}
Output:
Enter the number of minutes:
100
Hours: 1 Minutes: 40 Total rent: 80