Add 2 constructors to the Course class. One that takes no arguments and initializes the data to all 0’s and “” (empty strings).  And one constructor that takes all 4 arguments, one argument for each property and then sets the properties to these arguments that are passed in.  Lastly change the main to use these new Constructors.  You will not need to call the set functions any more, but do not remove the set functions from your class.     Main Code à   Course c1; c1 = new Course(323, “Intro to Php”, “Intro to Php Programming”,  4); c1.display(); Problem #2: Do the same as above for the Account class.         Problem #3: Do the same as above for the Person class.   Below is my Course code public class Course {   int Courzeld;   String CourteName;   String Description;   int creditHours;   void display() {       System.out.println("Course ID: " + Courzeld);       System.out.println("Course Name: " + CourteName);       System.out.println("Description: " + Description);       System.out.println("Credit Hours: " + creditHours);   }   public static void main(String[] args) {       Course c1;       c1 = new Course();       c1.CourteName = "Intro to Python";       c1.Description = "This course intros the Python Prog Lang.";       c1.Courzeld = 109;       c1.creditHours = 4;       c1.display();   } }   Here is my code for Account   public class Account {     private int AcctNo;     private String Owner;     private double balance;     public Account(int AcctNo, String Owner, double balance) {         this.AcctNo = AcctNo;         this.Owner = Owner;         this.balance = balance;     }     public int getAcctNo() {         return AcctNo;     }     public void setAcctNo(int AcctNo) {         this.AcctNo = AcctNo;     }     public String getOwner() {         return Owner;     }     public void setOwner(String Owner) {         this.Owner = Owner;     }     public double getBalance() {         return balance;     }     public void setBalance(double balance) {         this.balance = balance;     }     public void display() {         System.out.println("Account Number: " + AcctNo);         System.out.println("Owner: " + Owner);         System.out.println("Balance: $" + balance);     }     public static void main(String[] args) {         Account myAccount = new Account(12345, "John Doe", 1000.0);         myAccount.display();     } } And here is my code for Person class Person {     public String firstName;     public String lastName;     public String address;     public String email;     public void display() {         System.out.println("First Name: " + firstName);         System.out.println("Last Name: " + lastName);         System.out.println("Address: " + address);         System.out.println("Email: " + email);     }     public static void main(String[] args) {         Person person = new Person();         person.firstName = "John";         person.lastName = "Doe";         person.address = "123 Main Street, City, State, Zip";         person.email = "johndoe@example.com";         person.display();     } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 Add 2 constructors to the Course class. One that takes no arguments and initializes the data to all 0’s and “” (empty strings).  And one constructor that takes all 4 arguments, one argument for each property and then sets the properties to these arguments that are passed in.  Lastly change the main to use these new Constructors.  You will not need to call the set functions any more, but do not remove the set functions from your class.

 

 

Main Code à

 

Course c1;

c1 = new Course(323, “Intro to Php”, “Intro to Php Programming”,  4);

c1.display();

  • Problem #2: Do the same as above for the Account class.

 

 

 

 

  • Problem #3: Do the same as above for the Person class.

 

Below is my Course code

public class Course {
  int Courzeld;
  String CourteName;
  String Description;
  int creditHours;

  void display() {
      System.out.println("Course ID: " + Courzeld);
      System.out.println("Course Name: " + CourteName);
      System.out.println("Description: " + Description);
      System.out.println("Credit Hours: " + creditHours);
  }

  public static void main(String[] args) {
      Course c1;
      c1 = new Course();
      c1.CourteName = "Intro to Python";
      c1.Description = "This course intros the Python Prog Lang.";
      c1.Courzeld = 109;
      c1.creditHours = 4;
      c1.display();
  }
}
 
Here is my code for Account
 
public class Account {

    private int AcctNo;
    private String Owner;
    private double balance;


    public Account(int AcctNo, String Owner, double balance) {

        this.AcctNo = AcctNo;
        this.Owner = Owner;
        this.balance = balance;
    }
    public int getAcctNo() {
        return AcctNo;
    }
    public void setAcctNo(int AcctNo) {
        this.AcctNo = AcctNo;
    }
    public String getOwner() {
        return Owner;
    }
    public void setOwner(String Owner) {
        this.Owner = Owner;
    }
    public double getBalance() {
        return balance;
    }
    public void setBalance(double balance) {
        this.balance = balance;
    }
    public void display() {
        System.out.println("Account Number: " + AcctNo);
        System.out.println("Owner: " + Owner);
        System.out.println("Balance: $" + balance);
    }
    public static void main(String[] args) {
        Account myAccount = new Account(12345, "John Doe", 1000.0);
        myAccount.display();
    }
}
And here is my code for Person
class Person {
    public String firstName;
    public String lastName;
    public String address;
    public String email;

    public void display() {
        System.out.println("First Name: " + firstName);
        System.out.println("Last Name: " + lastName);
        System.out.println("Address: " + address);
        System.out.println("Email: " + email);
    }

    public static void main(String[] args) {
        Person person = new Person();
        person.firstName = "John";
        person.lastName = "Doe";
        person.address = "123 Main Street, City, State, Zip";
        person.email = "johndoe@example.com";
        person.display();
    }
}
 
 
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education