subject

Sammy’s 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, 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 {

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(""+"");

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits.now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order.finally, output thedigits in thearray.use at least two functions to organize your program.
Answers: 3
question
Computers and Technology, 23.06.2019 12:40
Curriculum exam to process a resident's payment, you must click on onesite payments home page. from the a. reports b. my settings o c.transactions o d. rent tab
Answers: 1
question
Computers and Technology, 23.06.2019 12:50
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
You know the right answer?
Sammy’s Seashore Supplies rents beach equipment such as kayaks, canoes, beach chairs, and umbrellas...
Questions
Questions on the website: 13722360