Question

Subjects: Develop two JavaBeans. Students can work together as a team (of up to 3 members),...

Subjects: Develop two JavaBeans.

Students can work together as a team (of up to 3 members), and it is ok to have a smaller group. Please include names of your team members in your submission, and each team only needs to submit one copy on Canvas.

Instructions: Create a Java Web Project in NetBeans. Within the project, create a package named as “beans” under the “Source Package”. Create two JavaBean classes for the “beans” package, one named as Course and another named as Student. Requirements for these two Java classes are as following:

Course class:

  • The class has the following private data fields: crn (int), course (String), title (String), credits (int), instructor (String), maxseats (int), seatsleft (int), college (String)
  • The class is qualified as a JavaBean class, i.e., you need to define the corresponding get and set methods for each data field and meet all JavaBean requirements.

Student class:

  • The class has the following private data fields: firstName (String), lastName (String), id (String), password (String), loggedIn (boolean)
  • The class is qualified as a JavaBean class, i.e., you need to define the corresponding get and set methods for each data field and meet all JavaBean requirements.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

eclipse-workspace - JavaBean/src/beans/Course.java Eclipse En (0:26, 34%) 4) 12:32 AM * ubuntu Quick Access Package Explorer

// Course.java

package beans;

public class Course

{

// variables

private int crn;

private String course;

private String title;

private int credits;

private String instructor;

private int maxseats;

private int seatsleft;

private String college;

// getters and setters

public int getCrn() {

return crn;

}

public void setCrn(int crn) {

this.crn = crn;

}

public String getCourse() {

return course;

}

public void setCourse(String course) {

this.course = course;

}

public String getTitle() {

return title;

}

public void setTitle(String title) {

this.title = title;

}

public int getCredits() {

return credits;

}

public void setCredits(int credits) {

this.credits = credits;

}

public String getInstructor() {

return instructor;

}

public void setInstructor(String instructor) {

this.instructor = instructor;

}

public int getMaxseats() {

return maxseats;

}

public void setMaxseats(int maxseats) {

this.maxseats = maxseats;

}

public int getSeatsleft() {

return seatsleft;

}

public void setSeatsleft(int seatsleft) {

this.seatsleft = seatsleft;

}

public String getCollege() {

return college;

}

public void setCollege(String college) {

this.college = college;

}

}




// Student.java

package beans;

public class Student

{

// variables

private String firstName;

private String lastName;

private String id;

private String password;

private boolean loggedIn;

// getters and setters

public String getFirstName() {

return firstName;

}

public void setFirstName(String firstName) {

this.firstName = firstName;

}

public String getLastName() {

return lastName;

}

public void setLastName(String lastName) {

this.lastName = lastName;

}

public String getId() {

return id;

}

public void setId(String id) {

this.id = id;

}

public String getPassword() {

return password;

}

public void setPassword(String password) {

this.password = password;

}

public boolean isLoggedIn() {

return loggedIn;

}

public void setLoggedIn(boolean loggedIn) {

this.loggedIn = loggedIn;

}

}

Add a comment
Know the answer?
Add Answer to:
Subjects: Develop two JavaBeans. Students can work together as a team (of up to 3 members),...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Java Project In Brief... For this Java project, you will create a Java program for a...

    Java Project In Brief... For this Java project, you will create a Java program for a school. The purpose is to create a report containing one or more classrooms. For each classroom, the report will contain: I need a code that works, runs and the packages are working as well The room number of the classroom. The teacher and the subject assigned to the classroom. A list of students assigned to the classroom including their student id and final grade....

  • PART I: Create an abstract Java class named “Student” in a package named “STUDENTS”. This class...

    PART I: Create an abstract Java class named “Student” in a package named “STUDENTS”. This class has 4 attributes: (1) student ID: protected, an integer of 10 digits (2) student name: protected (3) student group code: protected, an integer (1 for undergraduates, 2 for graduate students) (4) student major: protected (e.g.: Business, Computer Sciences, Engineering) Class Student declaration provides a default constructor, get-methods and set-methods for the attributes, a public abstract method (displayStudentData()). PART II: Create a Java class named...

  • You are building a system to keep track of matches played by a soccer team. You...

    You are building a system to keep track of matches played by a soccer team. You need to create a class to represent your matches. Call this class Soccer Match. The class will have the following data fields and methods: • A Date data field called startTime to register the date and time for the start of the match. • A Date data field called endTime to register the date and time for the end of the match. A String...

  • c ++ Create a class Book with the data members listed below.     title, which is...

    c ++ Create a class Book with the data members listed below.     title, which is a string (initialize to empty string)     sales, which is a floating point value (as a double, initialize to 0.0) Include the following member functions:     Include a default constructor,     a constructor with parameters for each data member (in the order given above),     getters and setter methods for each data member named in camel-case. For example, if a class had a data...

  • Java Code: 2. Define a class ACCOUNT with the following members: Private members Acno of type...

    Java Code: 2. Define a class ACCOUNT with the following members: Private members Acno of type int Name of type String Balance of type float Public members void Init) method to enter the values of data members void Show) method to display the values of data members void Deposit(int Amt) method to increase Balance by Amt void Withdraw(int Amt) method to reduce Balance by Amt (only if required balance exists in account) float RBalance() member function that returns the value...

  • Horse Team(Java) . Horse -name:String -age:int -weight:double +Horse():void +Horse(String, int double):void +getName():String +getAge():int +getWeight():double +setName(String):void +setAge(int):void...

    Horse Team(Java) . Horse -name:String -age:int -weight:double +Horse():void +Horse(String, int double):void +getName():String +getAge():int +getWeight():double +setName(String):void +setAge(int):void +setWeight(double):void +compareName(String):boolean +compareTo(Horse):int +toString():String Team -team:ArrayList<Horse> +Team():void +addHorse(String, int, double):void +addHorse(Horse):void +averageAge():int +averageWeight():int +getHorse(int):Horse +getSize():int +findHorse(String):Horse +largestHorse():Horse +oldestHorse():Horse +removeHorse(String):void +smallestHorse():Horse +toString():String +youngestHorse():Horse HorseTeamDriver +main(String[]):void Create a class (Horse from the corresponding UML diagram) that handles names of horse, the age of the horse, and the weight of the horse. In addition to the standard accessor and mutator methods from the instance fields, the class...

  • Writing 3 Java Classes for Student registration /** * A class which maintains basic information about...

    Writing 3 Java Classes for Student registration /** * A class which maintains basic information about an academic course. */ public class Course {    /** * Attributes. */ private String code; private String title; private String dept; // name of department offering the course private int credits; /** * Constructor. */ public Course(String code, String title, int credits) { // TODO : initialize instance variables, use the static method defined in // Registrar to initialize the dept name variable...

  • Language is JAVA. Clarification for the Shape class (highlighted): The following requirements specify what fields you...

    Language is JAVA. Clarification for the Shape class (highlighted): The following requirements specify what fields you are expected to implement in your Shape class; - A private String color that specifies the color of the shape - A private boolean filled that specifies whether the shape is filled - A private date (java.util.date) field dateCreated that specifies the date the shape was created Your Shape class will provide the following constructors; - A two-arg constructor that creates a shape with...

  • JAVA HELP (ARRAYS) Assignment Create a class named Module4 containing the following data members and methods...

    JAVA HELP (ARRAYS) Assignment Create a class named Module4 containing the following data members and methods (note that all data members and methods are for objects unless specified as being for the entire class) 1) Data members: none 2) Methods a. A method named displayContents that accepts an array of type int and prints their values to the b. A method named cemoveNegatives that accepts an array of type int, copies all its non-negative the new array should be the...

  • Naming Requirements: These are the names you are required to use for your lab project. Make...

    Naming Requirements: These are the names you are required to use for your lab project. Make sure the letter casing is also the same (for example, Example.java is not the same as example.java). Java file name: Student.java Main class name: Student MAKE SURE TO ONLY SUBMIT Student.java Core Requirements: In this lab, we will be creating our own Student class. Implement the following specification below to create the class. Private Data Members: String name int points Public Static Data Members:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT