Computer Programming Learning Part-08||Project-01||Calculating grade points with C++ programs.

in Steem4Professionalslast year

Steemian Friends,
Today, I will write Computer Programming Learning Part 08. I will create some small projects with C++ programs. Today, I will write a C++ program to get students' grade results. Hopefully, everyone who reads my writing will be able to create a program to calculate grades using C++.

Programming Learning Part 07 (1).png
Design By Canva

I first write the C++ program on white paper because it is convenient to write on the computer. If I make a mistake while writing on paper, I can correct it while writing on the computer.

IMG20240821154820.jpg

IMG20240821155312.jpg


Step 01:

I first open the computer and the Code Blocks software. Then I click on File. Then I click on Empty File from New File. Then, I see a code-writing page, shown as a red block in the image below.

code-01.png

code-02.png


Step 02:

Then, I declared the C++ program's header file and main function. Every C++ program must first declare these. Below, I have declared the header file and main function.

#include < iostream>
#include<conio.h>
Using namespace std;

int main()
{
}


Step 03:

Then, I will create my main program. I will declare an integer variable to generate the student's result grade. Then, I wrote code to store the result. I have written it below.

int mark;
Cout<<"Enter Mark:";
Cin>>Mark;


Step 04:

Then, I used a condition called if. If there are more than 100 marks, this condition will show an Invalid Mark result. I have written it below.

if(Mark>100)
{
Cout<<"Invalid Mark";
}


Step 05:

Then I used another condition called if else. If you get marks less than zero through this condition, it will show an Invalid Mark. I have written it below.

else if(Mark<0)
{
Cout<<"Invalid Mark";
}


Step 06:

Then I use the else if condition: if I get more than or equal to 80 marks, then it will show A+ as output. I have written it below.

else if(Mark>=80)
{
Cout<<"A+";
}


Step 07:

Then again, I used a condition that will show an A grade result if marks are equal to or above 70. I have written it below.

else if(Mark>=70)
{
Cout<<"A";
}


Step 08:

Then, I applied another condition, which will show an A-grade result if marks are equal to or above 60. I have written it below.

else if(Mark>=60)
{
Cout<<"A-";
}


Step 09:

Then, I applied another condition, which will show a B grade result if marks are equal to or above 50. I have written it below.

else if(Mark>=50)
{
Cout<<"B";
}


Step 10:

Then, I applied another condition, which will show a C grade result if marks are equal to or above 40. I have written it below.

else if(Mark>=40)
{
Cout<<"C";
}


Step 11:

Then, I applied another condition, which would show a D grade result if marks were equal to or above 33. I have written it below.

else if(Mark>=33)
{
Cout<<"D";
}


Step 12:

Then, I applied a condition: marks below 33 will show the result as Fail. I have written it below.

else
{
Cout<<"Fail";
}


Step 13:

Then I click the Run option and see the program's output. There was an error in writing my program, which I fixed. Then, a black page appears to view the output. Here, I type 70 and click enter. I see my desired result, an A grade. I have shown it in the red block below.

part-01.png

part-02.png

part-03.png


Program Output:

result.png

I am very happy to see the program's output. You can also create such a program by writing my program step by step.

Blue line.png

Link to my previous post:

Part-01Part-02Part-03Part-04Part-05Part-06Part-07

Blue line.png

Steemit.com.png

image.png

Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.

image.png

We support quality posts and good comments Published in any community and any tag.
Curated by : @solaymann

 last year 

Thank You Dear Sir...

Coin Marketplace

STEEM 0.13
TRX 0.33
JST 0.034
BTC 111130.52
ETH 4299.27
SBD 0.83