0% found this document useful (0 votes)
2 views1 page

Report Card Project

This C++ program calculates and displays a student's report card. It takes the student's name, roll number, and marks for three subjects as input, computes the total and average marks, and assigns a grade based on the average. The results are then printed to the console.

Uploaded by

shaiba wahab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Report Card Project

This C++ program calculates and displays a student's report card. It takes the student's name, roll number, and marks for three subjects as input, computes the total and average marks, and assigns a grade based on the average. The results are then printed to the console.

Uploaded by

shaiba wahab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <iostream>

#include <string>
using namespace std;

// Function to calculate grade


char calculateGrade(float average) {
if (average >= 90) return 'A';
else if (average >= 80) return 'B';
else if (average >= 70) return 'C';
else if (average >= 60) return 'D';
else return 'F';
}

int main() {
string name;
int rollNo;
float marks1, marks2, marks3;

// Input
cout << "Enter student name: ";
getline(cin, name);

cout << "Enter roll number: ";


cin >> rollNo;

cout << "Enter marks for Subject 1: ";


cin >> marks1;
cout << "Enter marks for Subject 2: ";
cin >> marks2;
cout << "Enter marks for Subject 3: ";
cin >> marks3;

// Processing
float total = marks1 + marks2 + marks3;
float average = total / 3;
char grade = calculateGrade(average);

// Output
cout << "\n----- Report Card -----\n";
cout << "Name: " << name << endl;
cout << "Roll Number: " << rollNo << endl;
cout << "Total Marks: " << total << endl;
cout << "Average Marks: " << average << endl;
cout << "Grade: " << grade << endl;

return 0;
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy