A college needs to review a student's academic progress every semester. This program collects a student's profile, marks, attendance, assignment scores, scholarship eligibility and fee payment details, then generates a complete semester report and tells the student exactly why they did or did not clear the semester.
The program handles one student at a time. After printing the report it asks the operator whether another student should be processed.
- Collects student profile details (ID, name, age, email, course, semester, career goal).
- Validates every numeric input with a re-entry loop.
- Calculates total marks, percentage, academic result and grade.
- Calculates attendance percentage and attendance status.
- Processes assignment scores with early exit (
-1) and invalid-score skipping. - Calculates scholarship discount, final payable fee, fee balance and fee status.
- Determines the final semester-clearance status.
- Lists every failed condition and a matching recommendation.
- Lets the operator process any number of students in one run.
Scannerfor runtime input (next(),nextLine(),nextInt(),nextDouble())- Handling the pending newline before
nextLine() - Primitive data types and
String - Arithmetic, assignment, relational and logical operators
- Explicit type casting for decimal calculations
if,else if,elseand compound/nested conditionsswitchfor the course menu- Ternary operator for status fields
while,do-whileandforloopsbreakandcontinueprintffor an aligned report
No arrays, collections, user-defined methods, extra classes, constructors,
exception handling, file handling or advanced OOP concepts are used. All
logic is written inside main.
| Field | Type | Notes |
|---|---|---|
| Student ID | String | single word |
| Full name | String | complete line |
| Age | int | 15-35 |
| String | single word | |
| Course choice | int | 1-5, menu driven |
| Semester | int | 1-8 |
| Career goal | String | complete line |
| Java / SQL / Web Technology / Aptitude / Communication marks | int | 0-100 each |
| Total classes conducted | int | 1-300 |
| Classes attended | int | 0 to total classes conducted |
| Number of assignments | int | 1-10 |
| Assignment score | int | 0-10, or -1 to finish early |
| Amount paid | double | 0 to final payable fee |
| Process another student | int | 1 = Yes, 0 = No |
- Age must be 15-35, else the program asks again.
- Course choice must be 1-5, else the program asks again.
- Semester must be 1-8, else the program asks again.
- Every subject mark must be 0-100, else the program asks again.
- Total classes conducted must be 1-300.
- Classes attended must be 0 to the total classes conducted (cannot exceed it).
- Number of assignments must be 1-10.
- Amount paid must be 0 to the final payable fee.
- "Process another student" choice must be 1 or 0.
- Minimum pass mark in every subject is 35.
- Percentage =
(double) total marks / 5, shown with 2 decimal places. - Academic criteria is passed only when all five subjects are >= 35 AND the percentage is >= 40. A high percentage never hides a failed subject.
- Grade (checked only after the academic result):
- Academic criteria failed ->
F - Percentage >= 85 ->
A+ - Percentage 75-84.99 ->
A - Percentage 65-74.99 ->
B - Percentage 50-64.99 ->
C - Percentage 40-49.99 ->
D
- Academic criteria failed ->
- Attendance percentage =
((double) classes attended / total classes conducted) * 100. - Attendance status (ternary):
REGULARwhen >= 75, otherwiseSHORTAGE.
- Operator enters how many assignment scores will be provided (1-10).
- For each entry:
-1stops entry immediately (break).- A score below
-1or above10is skipped with a warning (continue) and does not affect the total or count. - A score from
0to10is added to the total and increases the valid count.
- Assignment average =
(double) total / valid count, or0.00when no valid score was entered (avoids divide-by-zero). - Assignment status (ternary):
SATISFACTORYwhen at least one valid score was entered AND the average is >= 5, otherwiseNEEDS IMPROVEMENT.
Base semester fee by course:
| Course | Base fee |
|---|---|
| BCA | ₹35,000 |
| B.Sc Computer Science | ₹30,000 |
| B.E/B.Tech | ₹50,000 |
| MCA | ₹45,000 |
| Other | ₹25,000 |
Scholarship (the 10% condition is checked first):
| Condition | Discount |
|---|---|
| Academic criteria passed, percentage >= 85 and attendance >= 85 | 10% |
| Academic criteria passed, percentage >= 75 and attendance >= 75 | 5% |
| All other cases | 0% |
- Scholarship amount =
base fee * scholarship % / 100. - Final payable fee =
base fee - scholarship amount. - Fee balance =
final payable fee - amount paid. - Fee status (ternary):
PAIDwhen the balance is0, otherwisePENDING. - All monetary values are shown with exactly two decimal places.
The student is cleared only when all of the following are true:
Academic criteria passed
AND Attendance percentage >= 75
AND Assignment criteria passed
AND Fee balance == 0
Semester clearance (ternary): CLEARED FOR NEXT SEMESTER or
ACTION REQUIRED. Every failed condition is listed separately (never a
generic "Student failed" message), followed by a matching recommendation.
See pseudocode/pseudocode.txt.
Console output for each run is saved in the output folder.
| File | Scenario |
|---|---|
output/test-case-1.txt |
All conditions passed |
output/test-case-2.txt |
One subject failed despite a high percentage |
output/test-case-3.txt |
Exact boundary values (marks = 40, attendance = 75%, average = 5.00) |
output/test-case-4.txt |
Attendance shortage and pending fee |
output/test-case-5.txt |
Assignment continue (invalid score) and break (-1) |
Marks 88/82/79/76/80, attendance 102/120, assignments 8/9/7/8/9, fee paid in full.
Academic Result : PASSED
Grade : A
Attendance Status : REGULAR
Assignment Status : SATISFACTORY
Fee Status : PAID
Semester Clearance : CLEARED FOR NEXT SEMESTER
Marks 90/90/90/30/90 (percentage 78.00%).
Total Marks : 390/500
Percentage : 78.00%
Academic Result : FAILED
Grade : F
Semester Clearance : ACTION REQUIRED
Failed Conditions : - Aptitude marks are below 35.
All marks = 40, attendance 75/100, assignment scores 5/5/5.
Percentage : 40.00%
Academic Result : PASSED
Grade : D
Attendance Percentage : 75.00%
Attendance Status : REGULAR
Assignment Average : 5.00
Assignment Status : SATISFACTORY
Semester Clearance : CLEARED FOR NEXT SEMESTER
Academic result passed, attendance 70/100, amount paid ₹20,000 of ₹35,000.
Attendance Percentage : 70.00%
Attendance Status : SHORTAGE
Fee Balance : ₹15000.00
Fee Status : PENDING
Semester Clearance : ACTION REQUIRED
Failed Conditions : - Attendance is below 75%.
- Semester fee is pending.
5 assignments requested; scores 8, 15 (invalid, skipped), 6, -1 (finish early).
Valid Assignments : 2
Assignment Total : 14
Assignment Average : 7.00
Assignment Status : SATISFACTORY
Enter student ID: STU101
Enter full name: Ananya Rao
Enter age: 20
Enter email: ananya@gmail.com
Select course:
1. BCA
2. B.Sc Computer Science
3. B.E/B.Tech
4. MCA
5. Other
Enter course choice: 3
Enter semester (1-8): 4
Enter career goal: Become a Java backend developer
Enter Java marks: 88
Enter SQL marks: 82
Enter Web Technology marks: 79
Enter Aptitude marks: 76
Enter Communication marks: 80
Enter total classes conducted: 120
Enter classes attended: 102
How many assignment scores do you want to enter? 5
Enter score for assignment 1 (0-10, -1 to finish): 8
Enter score for assignment 2 (0-10, -1 to finish): 9
Enter score for assignment 3 (0-10, -1 to finish): 7
Enter score for assignment 4 (0-10, -1 to finish): 8
Enter score for assignment 5 (0-10, -1 to finish): 9
Enter amount paid: 47500
Enter choice: 0
========================================================
STUDENT SEMESTER REPORT
========================================================
Student ID: STU101
Student Name: Ananya Rao
Age: 20
Email: ananya@gmail.com
Course: B.E/B.Tech
Semester: 4
Career Goal: Become a Java backend developer
---------------- ACADEMIC SUMMARY --------------------
Java Marks: 88
SQL Marks: 82
Web Technology Marks: 79
Aptitude Marks: 76
Communication Marks: 80
Total Marks: 405/500
Percentage: 81.00%
Academic Result: PASSED
Grade: A
---------------- ATTENDANCE SUMMARY ------------------
Classes Conducted: 120
Classes Attended: 102
Attendance Percentage: 85.00%
Attendance Status: REGULAR
---------------- ASSIGNMENT SUMMARY ------------------
Valid Assignments: 5
Assignment Total: 41
Assignment Average: 8.20
Assignment Status: SATISFACTORY
---------------- FEE SUMMARY -------------------------
Base Semester Fee: ₹50000.00
Scholarship Percentage: 5%
Scholarship Amount: ₹2500.00
Final Payable Fee: ₹47500.00
Amount Paid: ₹47500.00
Fee Balance: ₹0.00
Fee Status: PAID
---------------- FINAL STATUS ------------------------
Semester Clearance: CLEARED FOR NEXT SEMESTER
---------------- FAILED CONDITIONS -------------------
None
---------------- RECOMMENDATIONS ---------------------
Maintain the current performance in the next semester.
========================================================
The full, unedited console output for every test case (including the
prompts) is saved in the output folder.
javac -d out src/Main.java
java -cp out Main
The JDK is used to develop and compile the Java program. The Java compiler converts source code into bytecode. The JRE provides the environment required to run the program. The JVM executes the generated bytecode. The same bytecode can run on different operating systems that have a compatible JVM, making Java platform-independent.
Third-PRD/
├── README.md
├── src/
│ └── Main.java
├── pseudocode/
│ └── pseudocode.txt
└── output/
├── test-case-1.txt
├── test-case-2.txt
├── test-case-3.txt
├── test-case-4.txt
└── test-case-5.txt