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 they rented the piece of sports equipment. Compute the rental cost as $40 per hour plus $1 for each additional minute. (Fix the logic error from Sammy's Rental program)



Display Sammy’s motto “Sammy’s makes it fun in the sun” surrounded by a border composed of repeated “Ss.” Save the file as SammysRental2.java

I just need lines of code and thats it

Respuesta :

Answer:

import java.util.*;

public class SammysRentalPrice {

public static void main(String[] args) {

 System.out.println("SsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSs");

 System.out.println("Sammy's makes it fun in the sun");

 System.out.println("SsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSs");

 Scanner s=new Scanner(System.in);

 System.out.print("Enter the rented minutes:");  

 int min=s.nextInt();

 int hours=min/60;

 min=min%60;

 int tot_cost=(hours*40)+(min*1);

 

 System.out.println("total hours is: "+hours);

 System.out.println("total minutes is: "+min);

 System.out.println("total cost is: "+tot_cost);

 

}

}

Explanation: This is the code I made.