Scholarship Scheme Calculation ProgramYou are tasked with developing a scholarship scheme calculation program for a university. The program will determine the amount of fees to be waived for students based on their academic excellence and sports achievements. Requirements:Student Class Hierarchy: Create an abstract class Student with the following attributes:regNo (Registration Number)name (Name of the student)FEES (Static constant representing the total fees, which is set to 2,00,000)Implement an abstract method calculateFees() in the Student class.Implement two subclasses of Student:AcademicExcellence: Contains attributes:CGPA (Grade Point Average)AI (Annual Income)Sports: Contains attributes:sportLevel (Level of sports achievement: State, National, International)noOfGamesPlayed (Number of games played by the student)Scholarship Criteria: For AcademicExcellence:If CGPA is 'S' and AI is less than 30,000, the entire fees will be waived.If CGPA is 'A' and AI is between 31,000 to 1 lakh, 50% of the fees will be waived.Otherwise, no fees will be waived.For Sports:If the student is an international player and has played more than 2 games, the entire fees will be waived.If the student is a national player and has played more than 10 games, 50% of the fees will be waived.If the student is a state player and has played between 20 to 30 games, 25% of the fees will be waived.Otherwise, no fees will be waived.Input/Output Format: Prompt the user to input the number of students.For each student, ask whether they are applying based on academic excellence or sports.Depending on the choice:For AcademicExcellence: Ask for regNo, name, CGPA, and AI.For Sports: Ask for regNo, name, sportLevel, and noOfGamesPlayed.Calculate and display the fees to be paid by each student based on the scholarship criteria.
Question
Scholarship Scheme Calculation ProgramYou are tasked with developing a scholarship scheme calculation program for a university. The program will determine the amount of fees to be waived for students based on their academic excellence and sports achievements. Requirements:Student Class Hierarchy: Create an abstract class Student with the following attributes:regNo (Registration Number)name (Name of the student)FEES (Static constant representing the total fees, which is set to 2,00,000)Implement an abstract method calculateFees() in the Student class.Implement two subclasses of Student:AcademicExcellence: Contains attributes:CGPA (Grade Point Average)AI (Annual Income)Sports: Contains attributes:sportLevel (Level of sports achievement: State, National, International)noOfGamesPlayed (Number of games played by the student)Scholarship Criteria: For AcademicExcellence:If CGPA is 'S' and AI is less than 30,000, the entire fees will be waived.If CGPA is 'A' and AI is between 31,000 to 1 lakh, 50% of the fees will be waived.Otherwise, no fees will be waived.For Sports:If the student is an international player and has played more than 2 games, the entire fees will be waived.If the student is a national player and has played more than 10 games, 50% of the fees will be waived.If the student is a state player and has played between 20 to 30 games, 25% of the fees will be waived.Otherwise, no fees will be waived.Input/Output Format: Prompt the user to input the number of students.For each student, ask whether they are applying based on academic excellence or sports.Depending on the choice:For AcademicExcellence: Ask for regNo, name, CGPA, and AI.For Sports: Ask for regNo, name, sportLevel, and noOfGamesPlayed.Calculate and display the fees to be paid by each student based on the scholarship criteria.
Solution
Sure, I can help with that. Here's a step-by-step guide on how to implement this program:
- First, create an abstract class
Studentwith attributesregNo,name, and a static constantFEESset to 200000. Also, declare an abstract methodcalculateFees().
public abstract class Student {
protected String regNo;
protected String name;
static final int FEES = 200000;
public Student(String regNo, String name) {
this.regNo = regNo;
this.name = name;
}
public abstract int calculateFees();
}
- Create a subclass
AcademicExcellencethat extendsStudent. It should have additional attributesCGPAandAI. Override thecalculateFees()method based on the given criteria.
public class AcademicExcellence extends Student {
private String CGPA;
private int AI;
public AcademicExcellence(String regNo, String name, String CGPA, int AI) {
super(regNo, name);
this.CGPA = CGPA;
this.AI = AI;
}
@Override
public int calculateFees() {
if (CGPA.equals("S") && AI < 30000) {
return 0;
} else if (CGPA.equals("A") && AI >= 31000 && AI <= 100000) {
return FEES / 2;
} else {
return FEES;
}
}
}
- Similarly, create a subclass
Sportsthat extendsStudent. It should have additional attributessportLevelandnoOfGamesPlayed. Override thecalculateFees()method based on the given criteria.
public class Sports extends Student {
private String sportLevel;
private int noOfGamesPlayed;
public Sports(String regNo, String name, String sportLevel, int noOfGamesPlayed) {
super(regNo, name);
this.sportLevel = sportLevel;
this.noOfGamesPlayed = noOfGamesPlayed;
}
@Override
public int calculateFees() {
if (sportLevel.equals("International") && noOfGamesPlayed > 2) {
return 0;
} else if (sportLevel.equals("National") && noOfGamesPlayed > 10) {
return FEES / 2;
} else if (sportLevel.equals("State") && noOfGamesPlayed >= 20 && noOfGamesPlayed <= 30) {
return (FEES * 3) / 4;
} else {
return FEES;
}
}
}
- Now, in your main method, prompt the user to input the number of students. For each student, ask whether they are applying based on academic excellence or sports. Depending on the choice, create an instance of
AcademicExcellenceorSportsand call thecalculateFees()method to display the fees to be paid by each student.
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the number of students: ");
int numStudents = scanner.nextInt();
for (int i = 0; i < numStudents; i++) {
System.out.println("Is the student applying based on academic excellence or sports? (Enter 'A' for academic excellence and 'S' for sports)");
String choice = scanner.next();
if (choice.equals("A")) {
System.out.println("Enter regNo, name, CGPA, and AI: ");
String regNo = scanner.next();
String name = scanner.next();
String CGPA = scanner.next();
int AI = scanner.nextInt();
AcademicExcellence student = new AcademicExcellence(regNo, name, CGPA, AI);
System.out.println("Fees to be paid: " + student.calculateFees());
} else if (choice.equals("S")) {
System.out.println("Enter regNo, name, sportLevel, and noOfGamesPlayed: ");
String regNo = scanner.next();
String name = scanner.next();
String sportLevel = scanner.next();
int noOfGamesPlayed = scanner.nextInt();
Sports student = new Sports(regNo, name, sportLevel, noOfGamesPlayed);
System.out.println("Fees to be paid: " + student.calculateFees());
}
}
}
This program will now calculate the fees to be paid by each student based on their academic excellence or sports achievements.
Similar Questions
Write a Java program that has three interfaces1. Academic Fees with a method calcAA() which takes the number of course as input parameter to calculate the academic fees by assigning Rs.500/- per course.2. Hostel Fees with a method calcHF() which takes the number of days as input parameter to calculate the hostel fees by assigning Rs.50/- per day.3. Extracurricular Fees with a method calcECF() which takes the number of extra-curricular course as input parameter to calculate the extra-curricular fees by assigning Rs.600/- per extra-curricular course.Create classes and objects using interface to calculate the total fees for1. A general day scholar student involved in no extracurricular courses2. A general hosteller student involved in no extracurricular courses3. A scholar student involved in extracurricular courses4. A hosteler student involved in extracurricular courses
Develop the Internal mark calculation system based on the attendance percentage using Java. Get the student name, register number, total number of working days in the semester and Number of days present. Calculate attendance percentage of the students and award attendance mark based on the following condition. Attendance percentage >=90 – 5 MarksAttendance percentage >=80 and < 90 – 4 MarksAttendance percentage >=75 and < 80 – 3 MarksAttendance percentage < 75 - 0 MarksImplement using inheritance
You are the new technology administrator of a college responsible for managing student data. The college offers four courses with their respective details:Science (Course Code: 1001, Credits: 10)Maths (Course Code: 1002, Credits: 5)Literature (Course Code: 1003, Credits: 5)Philosophy (Course Code: 1004, Credits: 1)Each student must enroll in exactly three courses, and their performance is graded from 0 to 10.Complete the C code for the program, by writing the code for the function float calculate_gpa(student s);This function takes as an input the struct student variable of a student s, which contains all the informationabout the courses the student s took and her grades in the courses.You have to return the total cgpa of the student as the output.Input:The first line contains the number of students, n.The next n lines contain information about each student in the following order:NameCourse Code 1Marks 1Course Code 2Marks 2Course Code 3Marks 3Output:The names and CGPAs (to a single decimal point) of students, each line in the following format:Name CGPAInput11Bala 1001 9 1002 10 1003 8OutputBala 9.0ExplanationBala has scored9/10 in 1001 (10 Credits)10/10 in 1002 (5 Credits)8/10 in 1003 (5 Credits)So his total cgpa is 9∗10+10∗5+8∗5/10+5+5=180/20=9.0
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.
Construct a class Person with attributes name, age, address and a methoddisplay() to display the details. Create a subclass Student with attributesrollno, mark1, mark2, and mark3. Override display() method and calculatethe grade. Create another subclass Faculty with attributes faculty_id,department, basic_pay and DA. Override display() method to calculate totalsalary as (basic_pay + DA) + 70% of (basic_pay + DA). Create instances ofStudent and Faculty and display the details
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.