π Grade Calculator in C++ π» A simple project that reads student marks from a file π, calculates averages & grades π, and generates formatted results in console and output file π. Built using arrays, functions, loops, conditions, and file handling concepts in C++ π
A simple yet well-structured Grade Calculator project developed in C++ for Programming Fundamentals. This project reads student data from a file, calculates averages and grades, and generates formatted results in both the console and output file.
β
Read student names and marks from file
β
Calculate student averages
β
Assign grades automatically
β
Calculate class average
β
Save formatted results to output.txt
β
Display complete report on console
β
Modular programming using functions
- π» C++
- π File Handling (
ifstream,ofstream) - π Loops
- π§ Conditional Statements
- π¦ Arrays
- βοΈ Functions
GRADE-CALCULATOR/
β
βββ Grade Calculator.cpp
βββ input.txt
βββ output.txt
βββ README.mdThe program reads data from input.txt.
Example:
Ali 78 85 90 88 92
Ahmed 67 70 72 69 75
Sara 95 91 93 97 96The program generates:
- Student marks table
- Average of each student
- Grade of each student
- Class average
Output is displayed:
- On Console π₯οΈ
- In
output.txtπ
| Average | Grade |
|---|---|
| 90 - 100 | A |
| 80 - 89 | B |
| 70 - 79 | C |
| 60 - 69 | D |
| Below 60 | F |
- Clone the repository
git clone https://github.com/Nouman-Irfan/GRADE-CALCULATOR.git-
Open project in Visual Studio / Dev C++ / CodeBlocks
-
Make sure
input.txtexists in project directory -
Compile and Run
βΆοΈ
- File Handling
- Arrays
- Functions
- Modular Programming
- Data Processing
- Console Formatting
Muhammad Nouman π BS Computer Science Student
This project was created as a Programming Fundamentals assignment to strengthen understanding of basic C++ concepts and problem-solving skills.