QuestionQuestion

The focus of this assignment is to create your own class and use it in a program. In this assignment you will create a class for a billing System. The following criteria for the class should be implemented and placed in the file PatientBill.java

• Variables each for First Name, Last Name, Account ID, and Amount Owed. All variables should be private. NO additional variables will be allowed.
• Blank and Variable Constructors
• Method for Setting each variable individually
• Method for Getting Each Variable individually
• Method to Process Payment. This will ask the user for a payment and display the new balance. If the payment exceeds the amount owed the payment should fail. The correct balance needs to be updated in the instance
• Method for Printing

The main program using the class will need to perform the following actions and the file will be entitled PatientBillProg.java
1. Create a blank instance and fill using the setting methods
2. Create a new instance using the constructor with arguments to set the values
3. Print Both Instances. Make sure to use output labels to make the output readable
4. For one of the instances make a payment and print the instance so I can see the change
5. Ask the user for the number of entries and create an array of the object of that size
6. Fill in the requested number through user input
7. Ask the user for an ID to search. If found in the array print the entry, if not print “Entry could not be found”
For the assignment, you need to submit both your Java source code and the screen output that resulted when you ran the program. Remember to include comments in the source code to explain what the code is doing.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

public class PatientBill {

// Variable for first name
private String firstName;
// Variable for last name
private String lastName
// Variable for account ID
private String accountID;
// Variable for amount owed
private double amountOwed;

// Blank constructor
public PatientBill() {
    firstName = "";
    lastName = "";
    accountID = "";
    amountOwed = 0.0;
}

// Variable constructor
public PatientBill(String firstName, String lastName, String accountID, double amountOwed) {
    this.firstName = firstName;
    this.lastName = lastName;
    this.accountID = accountID;
    this.amountOwed = amountOwed;
}

// Method to set first name
public void setFirstName(String firstName) {
    this.firstName = firstName;
}

// Method to get first name
public String getFirstName() {
    return firstName;
}

// Method to set last name
public void setLastName(String lastName) {
    this.lastName = lastName;
}...
$50.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats