1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ahrayia [7]
3 years ago
15

Write the complete class declaration for the class StudentReserve. Include all necessary instance variables and implementations

of its constructor and method(s). The constructor should take a parameter that indicates the number of days in advance that this pass is being reserved. The toString method should include a notation that a student ID is required for this pass. A StudentReserve pass costs half of what that Reserve pass would normally cost. If the pricing scheme for Reserve passes changes, the StudentReserve price should continue to be computed correctly with no code modifications to the StudentReserve class.
Computers and Technology
1 answer:
marissa [1.9K]3 years ago
6 0

Answer:

Explanation:

There is a lot of needed information that is missing in this question including all of the instance variables, what methods are required and what they need to do. The following code is a rough estimate of some of the basic methods and instance variables that are needed based on the information provided in the question.

package sample;

public class StudentReserve {

   public String getName() {

       return name;

   }

   public void setName(String name) {

       this.name = name;

   }

   public String getId() {

       return id;

   }

   public void setId(String id) {

       this.id = id;

   }

   String name, id;

   int studentReservePrice, reservedDays;

   public void StudentReserve(int numOfDays) {

       this.reservedDays = numOfDays;

   }

   public String toString() {

       System.out.println("A Student ID is required");

       return null;

   }

   public int getStudentReservePrice(int regularReservePrice) {

       this.studentReservePrice = regularReservePrice / 2;

       return studentReservePrice;

   }

}

You might be interested in
Select the correct answer. Which statement is true about the guardian archetype?
kobusy [5.1K]

Answer:

They assist the hero in difficult situations

Explanation:

because its right

3 0
3 years ago
What command line utility can be used to repair the bcd on a windows installation?
Afina-wow [57]
You can use the following command Bootrec /rebuildbcd
8 0
3 years ago
What is a dbms in full
Alika [10]

database management system

5 0
3 years ago
PLEASE HURRY!!
PtichkaEL [24]

Answer: I would say the first one

Explanation: I have never seen an interactive button for use in autoformatting at least on a presentation

8 0
3 years ago
Tyesha is trying to create a resume using a template on Word, but she can not figure it out. What wrong step does she make in th
abruzzese [7]
Heading selection on Word Document
8 0
3 years ago
Other questions:
  • How is the Task Manager helpful in displaying which resources your computer is using and how fast?
    5·2 answers
  • Given a one dimensional array arr, what is the correct way ofgetting the number of elements in arr
    15·1 answer
  • Computer with a domain name is called a
    7·1 answer
  • A computer system has 9,850 processes and 172 of them were suspended while 276 of them were terminated. Explain why some of the
    12·1 answer
  • (1) Output a menu of automotive services and the corresponding cost of each service. (2 pts)Ex:Davy's auto shop servicesOil chan
    9·1 answer
  • What is an example of technology that helps support the idea of continental drift.
    15·1 answer
  • Why was 1990 an important year regarding air quality?
    15·2 answers
  • Second Largest, Second Smallest Write a program second.cpp that takes in a sequence of integers, and prints the second largest n
    15·1 answer
  • PLZ HELP ASAP
    13·1 answer
  • Define two benefits to members of the community of replacing the printed copy with an online version.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!