Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am having an increadibly hard time with java. Brand new to it and I think I am over my head. Would someome be able

I am having an increadibly hard time with java. Brand new to it and I think I am over my head. Would someome be able to assist with this? I got the first part see below. But I am lost at the rest. Thanks!!

Sammys Seashore Supplies rents beach equipment such as kayaks, canoes, beach chairs, and umbrellas to tourists. In Chapter 3, you created a Rental class for the company. The Rental class contains two public final static fields that hold the number of minutes in an hour and the hourly rental rate ($40), and four private fields that hold a contract number, number of hours for the rental, number of minutes over an hour, and the price. It also contains two public set methods and four public get methods. Now, modify the Rental class to contain two overloaded constructors. One constructor accepts a contract number and number of minutes as parameters. Pass these values to the setContractNumber() and setHoursAndMinutes() methods, respectively. The setHoursAndMinutes() method will automatically calculate the hours, extra minutes, and price. The other constructor is a default constructor that passes A000 and 0 to the two-parameter constructor. Save the file as Rental.java. b. InChapter3,youalsocreatedaRentalDemoclasstodemonstrateaRental object. Now, modify that class to instantiate two Rental objects. Instantiate one object to retain the constructor default values. Accept user data for the contract number and minutes fields and use this data set to instantiate the second object. Display all the details for both objects. Save the file as RentalDemo.java.

import java.util.Scanner;
public class SammysRentalPriceWithMethods {
public static void main(String[] args) {
// put a motto string
String sammyMotto=
"Sammy's makes it fun in the sun";
System.out.println("Sammy's Motto");
System.out.println("**********************"+"**********************");
// print motto string to console
System.out.println("*\t"+sammyMotto+"\t*");
System.out.println("**********************"+"**********************");

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago

Question

=+and non-compete agreements in three to five different countries.

Answered: 1 week ago