Develop a java application to implement the following: Create a class named " MarkSheet" and declare two variables Name ,CGPA. And also Define two methods Readdata(), Displaydata().Your program shoud read data for three students and display the values using array of objects. Sample output Nithin 9.6 Amrith 8.9 Sonu 9.0
Question
Develop a java application to implement the following:
Create a class named " MarkSheet" and declare two variables Name ,CGPA. And also Define two methods Readdata(), Displaydata().Your program shoud read data for three students and display the values using array of objects.
Sample output
Nithin
9.6
Amrith
8.9
Sonu
9.0
Solution
Here is a simple Java application that meets your requirements:
import java.util.Scanner;
class MarkSheet {
String Name;
double CGPA;
void Readdata() {
Scanner sc = new Scanner(System.in);
System.out.println("Enter Name: ");
Name = sc.nextLine();
System.out.println("Enter CGPA: ");
CGPA = sc.nextDouble();
}
void Displaydata() {
System.out.println("Name: " + Name);
System.out.println("CGPA: " + CGPA);
}
}
public class Main {
public static void main(String[] args) {
MarkSheet[] students = new MarkSheet[3];
for (int i = 0; i < 3; i++) {
students[i] = new MarkSheet();
students[i].Readdata();
}
for (int i = 0; i < 3; i++) {
students[i].Displaydata();
}
}
}
This program creates a class named MarkSheet with two variables Name and CGPA. It also defines two methods Readdata() and Displaydata(). The Readdata() method reads the name and CGPA of a student from the user. The Displaydata() method displays the name and CGPA of a student.
In the main method, an array of MarkSheet objects is created to store the data of three students. A loop is used to call the Readdata() method for each student. Another loop is used to call the Displaydata() method for each student, which displays the name and CGPA of each student.
Similar Questions
Create a class called "Student" with private member variables for name, roll number, and marks in three subjects. Include public member functions to set the student details, calculate the average marks, and display the student detail
You are developing a Student Record Management System in C. The system needs to store and manage information for multiple students, including their names, roll numbers, and marks obtained in different subjects. Implement array in structures to read, write, and compute average marks and the students scoring above and below the average marks for a class of N students. INPUT/OUTPUT EXAMPLE: Enter the number of students: 3 Enter details for 3 students: Student 1: Name: A Roll Number: 1 Marks in 5 subjects: Subject 1: 12 Subject 2: 13 Subject 3: 14 Subject 4: 15 Subject 5: 16 Student 2: Name: BB Roll Number: 2 Marks in 5 subjects: Subject 1: 11 Subject 2: 13 Subject 3: 12 Subject 4: 15 Subject 5: 14 Student 3: Name: CC Roll Number: 10 Marks in 5 subjects: Subject 1: 13 Subject 2: 14 Subject 3: 16 Subject 4: 17 Subject 5: 11 Class average marks: 13.73 Students scoring above average: A (Roll Number: 1) CC (Roll Number: 10) Students scoring below average: BB (Roll Number: 2)
Object Oriented Programming - JavaDiv I – Batch 2“Teacher Assessment - College”Note : Marks : 251. Announcement Date: 30-11-2023.2. Due date: 06-12-2023 till 08:00 pm.3. The assignment to be done “individually” or with group of “three students” maximum.4. Assignment must be implemented in “Java” only.5. Assume data types and data, wherever it is required.6. Though viva will be at different times for different students, the submission deadline is same forall.7. No Copying / sharing of code are allowed for this assignment. If any such case identified, theoriginal author and person who has copied both will be “penalized” equally and “zero marks”will be awarded.8. Dates for assignment viva will be announced later.Task :A. Develop a JDBC project for relation “College”. Use PostgreSQL as database.B. Write a “POJO class College” for private attributes given in following table with mentioned “keyconstraints”. Constructor, getters, setters and toString method must be there.C. Create a controller class for following methods. Use SQL query only to perform operations in allmethods. Create relation using SQL query only. Enrollment number must be auto generated seriallyfor all students.1. Create student (student name, division, gender, marks).2. Print student (enrollment no). {Print specific student data.}3. Calculate grade (student name). {Marks = 75 to 100 Grade A, Marks = 60 to 74 Grade B, Marks= 40 to 59 Grade C, Marks = 0 to 39 Grade D}4. Find students by gender (gender). {Print specific data.}5. Add Bonus marks (enrollment no, bonus marks). {Add bonus marks in original marks.}6. Change division (student name). {Change division and print.}7. Print students in range (min marks, max marks). {Print selected data.}D. Create a service class for calling all above methods in “menu driven” pattern.Relation :- CollegeEnrollmentNumber (PK)Student Name(NN) Division (NN) Gender (NN) Marks (NN)… ……Mr. Akhilesh LungeFaculty
Write Python code that ask the user to enter the number of students. After that ask the user to enter a mark for each student using a loop. Save all marks into an empty list using insert() method. Display all marks after finishing data entry.
You have been assigned to develop a Course Enrollment and Grade Management System in Java for a university. The system should provide functionality to enroll students in courses, assign grades to students, and calculate overall course grades for each student. The project should demonstrate the effective utilization of static methods and variables to keep track of enrollment and grade-related information across multiple instances of the Student and Course classes. It should also showcase your ability to manipulate object state and define behavior through instance methods.Requirements:Student Class:The Student class should have private instance variables to store student information such as name, ID, and enrolled courses.Implement appropriate access modifiers and provide public getter and setter methods for accessing and updating student information.Design a method to enroll students in courses. It should accept a Course object as a parameter and add the course to the student's enrolled courses.Implement a method to assign grades to students. It should accept a Course object and a grade for the student and update the student's grade for that course. Course Class:The Course class should have private instance variables to store course information such as course code, name, and maximum capacity.Use appropriate access modifiers and provide public getter methods for accessing course information.Implement a static variable to keep track of the total number of enrolled students across all instances of the Course class.Design a static method to retrieve the total number of enrolled students.CourseManagement Class:The CourseManagement class should have private static variables to store a list of courses and the overall course grades for each student.Use appropriate access modifiers to control access to the variables.Implement static methods to add new courses, enroll students, assign grades, and calculate overall course grades for each student.The addCourse method should accept parameters for course information and create a new Course object. It should add the course to the list of courses.The enrollStudent method should accept a Student object and a Course object. It should enroll the student in the course by calling the appropriate method in the Student class.The assignGrade method should accept a Student object, a Course object, and a grade. It should assign the grade to the student for that course by calling the appropriate method in the Student class.The calculateOverallGrade method should accept a Student object and calculate the overall course grade for that student based on the grades assigned to them.Administrator Interface:Develop an interactive command-line interface for administrators to interact with the Course Enrollment and Grade Management System.Display a menu with options to add a new course, enroll students, assign grades, and calculate overall course grades.Prompt the administrator for necessary inputs and call the appropriate methods in the CourseManagement and Student classes to perform the requested operations.Implement error handling to handle cases where invalid inputs are provided or when enrolling students in courses that have reached their maximum capacity.Documentation:Provide comprehensive documentation for the project, explaining the purpose and usage of each class, method, and variable.Describe how static methods and variables are utilized to track enrollment and grade-related information across multiple instances of the Student and Course classes.Include instructions for running the program and interacting with the administrator interface.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.