ammys Seashore Supplies rents beach equipment such as kayaks

ammy’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 additional minute. (You might have surmised
already that this rate has a logical flaw, but for now, calculate rates as described
here. You can fix the problem after you read the chapter on decision making.)
Display Sammy’s motto with the border that you created in the SammysMotto2
class in Chapter 1. Then display the hours, minutes, and total price. Save the
file as SammysRentalPrice.java.

Solution

import java.util.Scanner;
class SammysRentalPrice{
   public static void main(String[]args)
   {
       int time_in_hrs;  
       int time_in_min;
       int total_price;

       Scanner in = new Scanner(System.in);  

       System.out.println(\"Enter for how long you want to rent \");
       time_in_hrs = in.nextInt();
       time_in_min = in.nextInt();      
       total_price = 40*time_in_hrs + time_in_min*1;
      
       System.out.println(\"***************************** Sammy\'s Motto *****************************\");      
       System.out.println(\"* The time taken by him/her is \"+time_in_hrs +\" Hrs. and \"+ time_in_min +\"Mins *\");
       System.out.println(\"* The total price is : \"+total_price+\" *\");
}
}

ammy’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 nu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site