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
Participants in open _________ community projects get experience and make connections with other professionals that can be valua
aleksandrvk [35]

Participants in open source community projects get experience and make connections with other professionals that can be valuable resources during a job hunt.

8 0
3 years ago
Mary is a big fan of tropical fish. She has a few tanks of fish at home. To maintain a healthy environment for the fish, she nee
astra-53 [7]

Answer:

Answered below

Explanation:

# Program is written in Python programming language

conditioner_in_ml = 0

width = float(input("Enter width in inches: "))

height = float(input("Enter height in inches: "))

length = float (input("Enter length in inches: "))

#Calculate the volume

volume = width * length * height

#Calculate the amount of conditioner per 100 #cubic inches of volume

conditioner_in_ml = volume/ 100

print("The amount of conditioner required for $volume cubic inches is $conditioner_in_ml ml")

7 0
2 years ago
How do you open the Font dialog?​
Simora [160]

Explanation:

Click the Home tab.

In the Fonts group, click the dialog box launcher button.

The button is found in the lower-right corner of the Font group.

The Font dialog box contains all the commands for formatting text, including quite a few that didn’t find their way into the Font group on the Ribbon. As with all text formatting, the commands you choose in the Font dialog box affect any new text you type or any selected text in your document.

When you’ve finished setting up your font stuff, click the OK button. Or click Cancel if you’re just visiting.

Use the Ctrl+D keyboard shortcut to quickly summon the Font dialog box.

hope my answer helps

pls mark this as brainlist

be sure to follow me and I will follow you back

stay safe

good day

6 0
2 years ago
When resizing images or objects in a presentation, why should a user not utilize the sizing handles in the middle of the sides o
Volgvan

Answer:

b. It will resize the image but not maintain aspect ratio

Explanation: is correct. post protected

7 0
2 years ago
How to connect local account to domain account?
muminat
<span>Join them to the domain
Login with their domain credentials, logout
Login as local administrator (not the old account, not the new one, a 3rd local admin)
Right click My Computer and select properties
Select advanced system settings
Go to the Advanced tab
Click settings under user profiles
Select their old profile you want and click Copy to
Browse to the location of their new profile and overwrite it</span>

If the Copy button is grayed out then reboot and repeat steps two to nine.

8 0
3 years ago
Other questions:
  • Below is a chart representing portions of resumes from 3 applicants. Which best explains the applicants careers?
    11·1 answer
  • You have users who connect to the corporate network using their laptops. because these computers often access confidential data,
    9·1 answer
  • Write a program that reads in two integers typed on the keyboard and outputs their sum, difference, and product.
    12·1 answer
  • The advent of mobile systems run by Android and other operating systems opens a wide range of new system management and security
    5·1 answer
  • Nathan took a picture of his friends while they were on a field trip. He wants upload this picture to a photo-sharing site. He w
    7·1 answer
  • What is a new ransomware program that encrypts your personal files and demands payment for the files' decryption keys? Multiple
    10·1 answer
  • Accenture is helping a large retailer transform their online sales and services. The Data Analyst audits the client’s customer j
    12·1 answer
  • MATH PLZ HELP ITS DUE IN 4 MINUTES​
    6·2 answers
  • Do laws ever change to help enforce cyber hacking crimes
    5·2 answers
  • Write a method in pseudocode or Java called move that accepts a boolean[], integer value, and a boolean value. Your method shoul
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!