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
tester [92]
3 years ago
13

Create a java program that has a code file with main() in it and another code file with a separate class. You will be creating o

bjects of the class in the running program, just as the chapter example creates objects of the Account class. Your system creates a registration bills for the billing part of a college. Create a class called Registration that holds the following information: first name, last name, number of credits, additional fees. The class should have all the gets and sets and also have a method to show the bill (with their name and the total which is 70 per credit + the additional fees) to the student. (You cannot have spaces in variable names. So you might call the first one firstName, first_name, fname or any other appropriate and legal variable name. The write up above is telling you the information to be stored in English, not java). Create 2 objects of Registration in your main code class and display the bills to the user with the method that shows the bill. Then add 3 credit hours to the first one, and subtract 3 credit hours from the second one and show the bills for both to the user again. (Hint: use the get) to read it out to a variable, add 3 (or subtract 3 for the second on), then use the set0 to store it back in replacing the old number of credit hours in the object.) (You can hard code the names, credit hours, and additional hours you are storing in the 2 Registration objects or ask the used for them with a Scanner. Either way is fine. It is perfectly all right from a grading standpoint to just give it test values like the chapter example does).
Computers and Technology
1 answer:
WITCHER [35]3 years ago
3 0

Answer:

public class Registration {

   private String fname;

   private String lname;

   private int noCredits;

   private double additionalFee;

   public Registration(String fname, String lname, int noCredits, double additionalFee) {

       this.fname = fname;

       this.lname = lname;

       this.noCredits = noCredits;

       this.additionalFee = additionalFee;

   }

   public String getFname() {

       return fname;

   }

   public void setFname(String fname) {

       this.fname = fname;

   }

   public String getLname() {

       return lname;

   }

   public void setLname(String lname) {

       this.lname = lname;

   }

   public int getNoCredits() {

       return noCredits;

   }

   public void setNoCredits(int noCredits) {

       this.noCredits = noCredits;

   }

   public double getAdditionalFee() {

       return additionalFee;

   }

   public void setAdditionalFee(double additionalFee) {

       this.additionalFee = additionalFee;

   }

   public void showBill(){

       System.out.println("The bill for "+fname+ " "+lname+ " is "+(70*noCredits+additionalFee));

   }

}

THE CLASS WITH MAIN METHOD

public class RegistrationTest {

   public static void main(String[] args) {

       Registration student1 = new Registration("John","James", 10,

               5);

       Registration student2 = new Registration("Peter","David", 9,

               13);

       System.out.println("Initial bill for the two students: ");

       student1.showBill();

       student2.showBill();

       int newCreditStudent1 = student1.getNoCredits()+3;

       int newCreditStudent2 = student2.getNoCredits()-3;

       student1.setNoCredits(newCreditStudent1);

       student2.setNoCredits(newCreditStudent2);

       System.out.println("Bill for the two students after adjustments of credits:");

       student1.showBill();

       student2.showBill();

   }

}

Explanation:

  1. Two Java classes are created Registration and RegistrationTest
  2. The fields and all methods (getters, setters, constructor) as well as a custom method showBill() as created in the Registration class as required by the question
  3. In the registrationTest, two objects of the class are created and initialized student1 and student2.
  4. The method showBill is called and prints their initial bill.
  5. Then adjustments are carried out on the credit units using getCredit ()and setCredit()
  6. The new Bill is then printed
You might be interested in
Consider the following instructions for a game element: Move Forward If not at end, move forward Else stop This is an example of
xz_007 [3.2K]

Answer:

C.

Explanation:

8 0
2 years ago
You are a network administrator. Your company recently approved of employees working from home one day a week and the use of emp
Orlov [11]

Answer:

To establish the BYOD policy is the correct answer to the following question.

Explanation:

<u>Implementation of the BYOD(Bring Your Own Device)</u>:

  1. Firstly, set you objectives and establish it.
  2. Then, you have to decide and tell your employees that what types of devices are only allowed in your organization.
  3. Then, establish your security policies related to the BYOD policy.
  4. Then, give good training by you or by the IT professionals to your employees.
  5. Finally, if the employee are leaving your organization then, you have to remove those employees from the BYOD policy by which they cannot access your company's informations.
8 0
2 years ago
Which of the following is an example of a stereotype?
amm1812

Answer:

d)"I have a really bad feeling about her. I don't know why."

Explanation:

5 0
2 years ago
A _____ is a type of legal protection for which person can apply to protect an invention or a discovery.
shepuryov [24]

Answer:

patent

Explanation:

A patent is an intellectual property, with this legal protection, we can exclude to use, sell, and importation of an invention for a limited period of years, but we must do an enabling public disclosure of the invention or discovery, it is a requirement of the patent law, a patent is considered an advantage in the industries world.

3 0
3 years ago
In python, sorry if it’s blurry
stepan [7]

Answer:

nice

Explanation:

3 0
2 years ago
Read 2 more answers
Other questions:
  • Below is a chart representing portions of resumes from 3 applicants. Which best explains the applicants careers?
    11·1 answer
  • Can someone tell me how to get all A's with no effort?
    5·1 answer
  • Which one is correct
    8·1 answer
  • _____ of a global information system (GIS) concentrates on medium-range activities that move an organization toward achieving lo
    7·1 answer
  • What does the FixedUpdate loop do? Why do developers use it?
    14·1 answer
  • Rain forests clean the air by producing oxygen. Some rain forest plants have healing properties, and can be used as medicine. Ra
    12·1 answer
  • If you wanted to make the system sequentially consistent, what are the key constrains you need to impose
    6·1 answer
  • what impact of information communication technology have on the environment about electronic waste, use of electricity?​
    9·1 answer
  • Enterprise storage systems typically use fast Fibre Channel or ____ connections and are scalable so more hard drives can be adde
    7·1 answer
  • Record the issue of 4,000 shares of $5 par value common stock for $35000 cash
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!