Post 4 - Build a Student's Result Generator System using Java

Welcome to the blog !! Learning the concepts is easy but applying the same to solve problems is quite challenging task. So we will try to apply all the things learnt in all the previous posts to help teachers by building Student's Result Generator System.
Check previous posts here - Post 1 , Post 2 , Post 3

✅ Problem Statement:

Every Semester teachers manually calculate grade and percentages of student . They invest most of their time to accurately calculate result of each and every student. Today we will help them to automate this process by developing Student's Result Generator System which will automate the task of calculating grade and percentage of each student by entering marks obtained in each subject . We need to follow marking scheme given by teacher to assign grades .
Marking Scheme :
If percentage are in >= 80 Grade will be 'O'
If percentage are in < 80 and >= 70 Grade will be 'A'
If percentage are in < 70 and >= 60 Grade will be 'B'
If percentage are in < 60 and >= 50 Grade will be 'C'
If percentage are in < 50 and >= 35 Grade will be 'D'
If percentage are <35 , Grade will be 'F' with a note "Kindly make necessary preparation and Reattempt the exam "as marks are below passing criteria.

📑 Let's Code :)

Note* : As this post it for practicing purpose, it will not contain detail instructions for class creations. You can refer any previous post for detail instructions. 

Step 1: Open Eclipse Open Project / Create Project Create Package →  Create 2 Java Classes , ResultGenerator.java and Main.java 

ResultGenerator.java contain all the functionalities /  methods and Main.java contain main method to test those functionalities.

 Step 2: Now let's complete ResultGenerator.java -

This class contains - 
  • Parameterized Constructor
  • Getters and Setters
  • Method to calculate Percentage
  • Method to calculate Grade
  • Using if ... else in java 
Here is sample code for ResultGenerator.java :


ResultGenerator.java 1.1


ResultGenerator.java 1.2


 
Step 3: Now we will complete Main.java having main () method -

This class contains -
  • Object of ResultGenerator.java
  • Input No of Subjects and Marks 
  • Call methods from ResultGenerator.java and results in respective variables
  • Print Output to Console
Here is the sample code for Main.java : 

Main.java 2.1
                                                                  
Here we are done with coding . Now in the next step we will run this project.

Step 4 :  Run the Project and check the output.

Here i'm attaching output taken by running project twice using different values of marks.

Output 1

Output 2

We are done with one more project !!
You can Check Source Code Here

All the Best 👍👍👍
Happy Learning 😀😀❗❗


Post a Comment

Comments :

Previous Post Next Post