In Java:
Develop a simple class for a Student. Include class variables;
StudentID (int), FirstName, LastName,
GPA (double), and Major. Extend your class for a Student to include
classes for Graduate and Undergraduate.
o Include a default constructor, a constructor that accepts the
above information, and a
method that prints out the contents FOR EACH LEVEL of the object,
and a method that
prints out the contents of the object.
o Write a program that uses an array of Students in a course. Input
the Student information,
create the object, and add each student to the list. Use a
StudentID of -1 as a sentinel value.
o Print out the Students in the list.
Answer :-
class StudentDetails
{
public static void main(String s[])
{
Student students[] = new Student[5];
students[0] = new Student();
students[0].StudentID = 1001;
students[0].FirstName = "Rajesh";
students[0].LastName = "K";
students[0].GPA = '3.2';
students[1] = new Student();
students[0].StudentID = 1002;
students[0].FirstName = "Suresh";
students[0].LastName = "S";
students[0].GPA = '4.5';
students[2] = new Student();
students[0].StudentID = 1003;
students[0].FirstName = "Ramesh";
students[0].LastName = "k";
students[0].GPA = '4';
students[3] = new Student();
students[0].StudentID = 1004;
students[0].FirstName = "Kamlesh";
students[0].LastName = "j";
students[0].GPA = '3.5';
students[4] = new Student();
students[0].StudentID = 1005;
students[0].FirstName = "Vignesh";
students[0].LastName = "A";
students[0].GPA = '3';
for(int i = 0; i < students.length; i++)
{
System.out.println("StudentID"+ students[i].StudentID + "Student
FirstName " + students[i].FirstName + "Student LastName " +
students[i].LastName + students[i].GPA+"out of 5");
}
}
}
class Student
{
int StudentID;
String FirstName;
String LastName;
String address;
double GPA;
}
In Java: Develop a simple class for a Student. Include class variables; StudentID (int), FirstName, LastName,...
Help in database: User view requirement1: • For each student, store studentID, firstName, lastName, sex, majorDept, class, GPA. Assuming you will need to access students based on their names. User view requirement2: • For each department, store deptId, deptName, college. In addition, store the studentId, firstName, lastName of students major in each department. Suppose a student belongs to one department only. A department will have more than one students. Assuming you will need to access departments based on their names....
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...
Given a database with the following tables: Students FirstName CHAR(20) | LastName CHAR(20) | StudentID INT | Major CHAR(20) | Degree CHAR(5) | Scholarship BOOLEAN | GPA FLOAT(3,2) | CreditsEarned INT | CreditsAttempted INT Classes ClassID INT | Title VARCHAR(50) | Description VARCHAR(255) | Credits SMALLINT Enrollments ClassID INT | StudentID INT C) Retrieve the First Name, Last Name, Major and StudentID of all students with a Scholarship:
C++ program Create a Student class that contains three private data members of stududentID (int), lastName (string), firstName(string) and a static data member studentCount(int). Create a constructor that will take three parameters of studentID, lastName and firstName, and assign them to the private data member. Then, increase the studentCount in the constructor. Create a static function getStudentCount() that returns the value of studentCount. studentCount is used to track the number of student object has been instantiated. Initialize it to 0...
Language Java Step 1: Design a class called Student. The Student class should contain the following data: firstName lastName studentID totalCredits gpa Your class should implement the “sets” and “gets” for the class. Include methods: equals, compareTo, toString. Change the toString method (from class) to put each member variable on a new line. Step 2: Write a driver program to test that Student works correctly. Test is with 3 students as given in class. Step 3: Write a “registration” program...
Design a class named Student. The Student class should have a Firstname, a Lastname, an Address, an email address, a major and a GPA. Determine the data types for each property, then create the class diagram and write the pseudo-code that defines the class. You can use java language for pseudo-code
Registration Language Java Step 1: Design a class called Student. The Student class should contain the following data: firstName lastName studentID totalCredits gpa Your class should implement the “sets” and “gets” for the class. Include methods: equals, compareTo, toString. Change the toString method (from class) to put each member variable on a new line. Step 2: Write a driver program to test that Student works correctly. Test is with 3 students as given in class. Step 3: Write a “registration”...
Write a class called Course_xxx that represents a course taken at a school. Represent each student using the Student class from the Chapter 7 source files, Student.java. Use an ArrayList in the Course to store the students taking that course. The constructor of the Course class should accept only the name of the course. Provide a method called addStudent that accepts one Student parameter. Provide a method called roll that prints all students in the course. Create a driver class...
In Java programming language Please write code for the 6 methods below: Assume that Student class has name, age, gpa, and major, constructor to initialize all data, method toString() to return string reresentation of student objects, getter methods to get age, major, and gpa, setter method to set age to given input, and method isHonors that returns boolean value true for honors students and false otherwise. 1) Write a method that accepts an array of student objects, and n, the...
Question 1 (24 Marks] 1. (4 marks) Write an immutable Person class in Java which provides the following. • Two attributes: lastName and first Name of type String. • Appropriate initialization, accessors/mutator methods. 2. (6 marks) Write a Student class that is a subclass of Person class (in the previous question) which provides the following. • Two attributes: A unique student ID of type String and GPA of type float; the student ID is initialized when a Student object gets...