Question

Java program Create a Student Information System that includes the following 4 classes: Student, Courses, Instructor,...

Java program

Create a Student Information System that includes the following 4 classes: Student, Courses, Instructor, and Location.

Allow the user create a Student object with a course name, instructor, and location. After the user creates the object, make sure to print your Student object.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

import java.util.Scanner;

//Course call containing course name
class Courses
{
   private String cName;
   void setCourse(String cName){
       this.cName = cName;
   }
   String getCourse(){
       return this.cName;
   }
}

// Instructer class inheriting course class and containng Instructer name
class Instructer extends Courses
{
   private String iName;
   void setInstructer(String iName){
       this.iName = iName;
   }
   String getInstructer(){
       return this.iName;
   }
}


// Location class inheriting Instructer and containng location name
class Location extends Instructer
{
   private String lName;
   void setLocation(String lName){
       this.lName = lName;
   }
   String getLocation(){
       return this.lName;
   }
}

// Student calss inheriting Location class and have student name
class Student extends Location
{
   private String sName;
   void setStudentName(String sName){
       this.sName = sName;
   }
   String getStudentName(){
       return this.sName;
   }
}

// all classes with their own getters and setters.


//Student Information System Class
public class StudentIS
{
   public static void main(String[] args) {
       //Creating an object.
       Student s = new Student();
       Scanner in = new Scanner(System.in);

       //Taking the details of the object and storing in corresponding classes.

       // Name in student class's object
       // Taking student name is optional as per you statement
       System.out.println("Enter Student Name :");
       s.setStudentName(in.nextLine());

       // Course name in Course class's object
       System.out.println("Enter Course Name :");
       s.setCourse(in.nextLine());

       // Instructer name in instructer class's object
       System.out.println("Enter Instructer Name :");
       s.setInstructer(in.nextLine());

       // Location in Location Calss's object
       System.out.println("Enter Location :");
       s.setLocation(in.nextLine());

       //Printing the Details of the Object.
       System.out.println("Detials of the student are:");
       System.out.println("Student name: "+s.getStudentName());
       System.out.println("Couse: "+s.getCourse());
       System.out.println("Instructer: "+s.getInstructer());
       System.out.println("Location: "+s.getLocation());
   }
}

Output:

Hope your problem solved.

Feel free to ask doubts in comment section.

Add a comment
Know the answer?
Add Answer to:
Java program Create a Student Information System that includes the following 4 classes: Student, Courses, Instructor,...
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
  • Please draw a class diagram for the following classes and relationships We have classes: Instructor, Student,...

    Please draw a class diagram for the following classes and relationships We have classes: Instructor, Student, Main Menu, create account, login, create the student's passwords, create a course, view my courses, create an assignment, view my grades, create a new password And they have the following relations: 1. Instructor and Student can create an account 2. Instructor and student can login 3. Instructor must create the students' password Instructor can create a course, assignment, Instructor can view courses and grades...

  • You are asked to build and test the following system using Java and the object-oriented concepts ...

    You are asked to build and test the following system using Java and the object-oriented concepts you learned in this course: Project (20 marks) CIT College of Information technology has students, faculty, courses and departments. You are asked to create a program to manage all these information's. Create a class CIT to represents the following: Array of Students, each student is represented by class Student. Array of Faculty, each faculty is represented by class Faculty. Array of Course, each course...

  • The application should be in JAVA and allow: 1. Collect student information and store it in...

    The application should be in JAVA and allow: 1. Collect student information and store it in a binary data file. Each student is identified by an unique ID. The user should be able to view/edit an existing student. Do not allow the user to edit student ID. 2. Collect Course information and store it in a separate data file. Each course is identified by an unique ID. The user should be able to view/edit an existing course information. User is...

  • JAVA /** * This class stores information about an instructor. */ public class Instructor { private...

    JAVA /** * This class stores information about an instructor. */ public class Instructor { private String lastName, // Last name firstName, // First name officeNumber; // Office number /** * This constructor accepts arguments for the * last name, first name, and office number. */ public Instructor(String lname, String fname, String office) { lastName = lname; firstName = fname; officeNumber = office; } /** * The set method sets each field. */ public void set(String lname, String fname, String...

  • In JAVA please! Write program for exercises You will write a Graphical User Interface(GUI) application to manage student...

    In JAVA please! Write program for exercises You will write a Graphical User Interface(GUI) application to manage student information system. The application should allow: 1. Collect student information and store it in a binary data file. Each student is identified by an unique ID. The user should be able to view/edit an existing student. Do not allow student to edit ID. 2. Collect Course information and store it in a separate data file. Each course is identified by an unique...

  • Write a Java program which will store, manipulate, and print student registration information. As part of...

    Write a Java program which will store, manipulate, and print student registration information. As part of the solution, identify the following classes: Student Admissions. The class Student must have the following fields – Name, Address, Id number, Courses, and Date, where: Name is a user defined class comprising of at minimum first name and last name. Address is a user defined class comprising of fields - street, city, state, and zip code. Date is a predefined class in the java.util...

  • Java This application will be menu driven. The application should allow: 1. Collect student information and...

    Java This application will be menu driven. The application should allow: 1. Collect student information and store it in a binary data file. Each student is identified by an unique ID.   The user should be able to view/edit an existing student. Do not allow the user to edit student ID. 2. Collect Course information and store it in a separate data file. Each course is identified by an unique ID. The user should be able to view/edit an existing course...

  • Create a class hierarchy to be used in a university setting. The classes are as follows:...

    Create a class hierarchy to be used in a university setting. The classes are as follows: The base class is Person. The class should have 3 data members: personID (integer), firstName(string), and lastName(string). The class should also have a static data member called nextID which is used to assign an ID number to each object created (personID). All data members must be private. Create the following member functions: o Accessor functions to allow access to first name and last name...

  • Create a Java program that will store 10 student objects in an ArrayList, ArrayList<Student>. A student object con...

    Create a Java program that will store 10 student objects in an ArrayList, ArrayList<Student>. A student object consists of the following fields: int rollno String name String address Implement two comparator classes to sort student objects by name and by rollno (roll number). Implement your own selection sort method and place your code in a separate Java source file. Do not use a sort method from the Java collections library.

  • Design and code a JAVA program called ‘Grades’. ? Your system should store student’s name, and...

    Design and code a JAVA program called ‘Grades’. ? Your system should store student’s name, and his/her course names with grades. ? Your system should allow the user to input, update, delete, list and search students’ grades. ? Each student has a name (assuming no students share the same name) and some course/grade pairs. If an existing name detected, user can choose to quit or to add new courses to that student. ? Each student has 1 to 5 courses,...

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