SlideShare a Scribd company logo
1 of 5
Computerprogramming1st
assignment
1
Name: Taimur Muhammad
Class No: 12
Assignment No: 02
Subject: Computer programming
Topic: C++ Programming
Submitted to: Engineer Durr-e-Nayab
Dated: 24-10-2016
Computerprogramming1st
assignment
2
 Creating a GPA Calculatorthat will also find students grades.
#include <iostream>
usingnamespace std;//usingstandard
int main()
{int sb1,sb2,sb3,sb4,sb5,chr1,chr2,chr3,chr4,chr5;//declaringintegers
cout<<"welcome to u n";
cout<<"Enter the marks of subject 1 n";
cin>>sb1;//it will ask for the marks of subject 1
cout<<"Enter the credit hours of subject 1 n";
cin>>chr1;//it will ask for the credit hours of subject 1
cout<<"Enter the marks of subject 2 n";
cin>>sb2;//it will ask for the marks of subject 1
cout<<"Enter the credit hours of subject 2 n";
cin>>chr2;//it will ask for the credit hours of subject 1
cout<<"Enter the marks of subject 3 n";
cin>>sb3;//it will ask for the marks of subject 1
cout<<"Enter the credit hours of subject 3 n";
cin>>chr3;//it will ask for the credit hours of subject 1
cout<<"Enter the marks of subject 4 n";
cin>>sb4;//it will ask for the marks of subject 1
cout<<"Enter the credit hours of subject 4 n";
cin>>chr4;//it will ask for the credit hours of subject 1
Computerprogramming1st
assignment
3
cout<<"Enter the marks of subject 5 n";
cin>>sb5;//it will ask for the marks of subject 1
cout<<"Enter the credit hours of subject 5 n";
cin>>chr5;//it will ask for the credit hours of subject 1
double tcrh;//declaringtotal credit hours
tcrh=chr1+chr2+chr3+chr4+chr5;//total credit hours formulas
double GPA;//declaringGPA
GPA=(sb1*chr1+sb2*chr2+sb3*chr3+sb4*chr4+sb5*chr5)/tcrh;//GPA
formula
cout<<"THIS IS YOUR GPA n";
cout<<GPA;//Gives urGPA
char Grade;//declaringcharacter
if(GPA>0&&GPA<=20)//applyngdifferent conditionsforgrades
{Grade='F'; }
else if(GPA>20&&GPA<=40)
{Grade='E';}
else if(GPA>40&&GPA<=60)
{Grade='D';}
else if(GPA>60&&GPA<=70)
{Grade='C';}
else if(GPA>70&&GPA<=80)
{Grade='B';}
else if(GPA>80&&GPA<=100)
Computerprogramming1st
assignment
4
{Grade='A';}
else
Grade='I';
cout<<"n From ur data ,your GRADE is n";
cout<<Grade;//it will give you ur grade
return 0;
}
OUTPUT:-
1; When GPA is b/w 40 and 60 GRADE will be “D”.
2; when GPA is b/w 80 and 100 gives “A” grade.
Computerprogramming1st
assignment
5
3; when GPA is Greater than 100 grade will be “I” (INVALID).
4; when GPA is between 0 and 20 grade will be “F”.
**************************************************************

More Related Content

What's hot

Timing and-control-unit
Timing and-control-unitTiming and-control-unit
Timing and-control-unitAnuj Modi
 
Design issues for the layers
Design issues for the layersDesign issues for the layers
Design issues for the layersjayaprakash
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptxAcad
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniquesDr.Florence Dayana
 
Micro programmed control
Micro programmed  controlMicro programmed  control
Micro programmed controlShashank Singh
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulationrajshreemuthiah
 
Pipeline processing and space time diagram
Pipeline processing and space time diagramPipeline processing and space time diagram
Pipeline processing and space time diagramRahul Sharma
 
Information Security & Cryptography
Information Security & CryptographyInformation Security & Cryptography
Information Security & CryptographyArun ACE
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back trackingTech_MX
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registersSanjeev Patel
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra pptGirdharRatne
 

What's hot (20)

Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Timing and-control-unit
Timing and-control-unitTiming and-control-unit
Timing and-control-unit
 
Addressing sequencing
Addressing sequencingAddressing sequencing
Addressing sequencing
 
BNF & EBNF
BNF & EBNFBNF & EBNF
BNF & EBNF
 
Input-Buffering
Input-BufferingInput-Buffering
Input-Buffering
 
Design issues for the layers
Design issues for the layersDesign issues for the layers
Design issues for the layers
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
Micro programmed control
Micro programmed  controlMicro programmed  control
Micro programmed control
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Cache memory
Cache memoryCache memory
Cache memory
 
Pipeline processing and space time diagram
Pipeline processing and space time diagramPipeline processing and space time diagram
Pipeline processing and space time diagram
 
Information Security & Cryptography
Information Security & CryptographyInformation Security & Cryptography
Information Security & Cryptography
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
 
Asymmetric Cryptography
Asymmetric CryptographyAsymmetric Cryptography
Asymmetric Cryptography
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 

Viewers also liked (6)

CGPA
CGPACGPA
CGPA
 
C++ Project
C++ ProjectC++ Project
C++ Project
 
Unit 3
Unit 3Unit 3
Unit 3
 
conditional statements
conditional statementsconditional statements
conditional statements
 
Cgpa
CgpaCgpa
Cgpa
 
C if else
C if elseC if else
C if else
 

Similar to GPA calculator and grading program in c++

CCE management system
CCE management systemCCE management system
CCE management systemTrish004
 
DeVry GSP 115 Week 3 Assignment latest
DeVry GSP 115 Week 3 Assignment latestDeVry GSP 115 Week 3 Assignment latest
DeVry GSP 115 Week 3 Assignment latestAtifkhilji
 
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docxkatherncarlyle
 
Cs investrigatory project
Cs investrigatory projectCs investrigatory project
Cs investrigatory projectHGIUO
 
DeVry GSP 115 All Assignments latest
DeVry GSP 115 All Assignments latestDeVry GSP 115 All Assignments latest
DeVry GSP 115 All Assignments latestAtifkhilji
 
computer project code ''payroll'' (based on datafile handling)
computer project code ''payroll'' (based on datafile handling)computer project code ''payroll'' (based on datafile handling)
computer project code ''payroll'' (based on datafile handling)Nitish Yadav
 
4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)PROIDEA
 
Debugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template MetaprogramsDebugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template MetaprogramsPlatonov Sergey
 
Machine learning in php singapore
Machine learning in php   singaporeMachine learning in php   singapore
Machine learning in php singaporeDamien Seguy
 
Simple c program
Simple c programSimple c program
Simple c programRavi Singh
 
Machine learning in PHP
Machine learning in PHPMachine learning in PHP
Machine learning in PHPDamien Seguy
 

Similar to GPA calculator and grading program in c++ (20)

Shopping mall
Shopping mallShopping mall
Shopping mall
 
CCE management system
CCE management systemCCE management system
CCE management system
 
DeVry GSP 115 Week 3 Assignment latest
DeVry GSP 115 Week 3 Assignment latestDeVry GSP 115 Week 3 Assignment latest
DeVry GSP 115 Week 3 Assignment latest
 
College management
College managementCollege management
College management
 
KBC c++ program
KBC c++ programKBC c++ program
KBC c++ program
 
LAB 2 Report.docx
LAB 2 Report.docxLAB 2 Report.docx
LAB 2 Report.docx
 
computer shop
computer shopcomputer shop
computer shop
 
C++ Programm.pptx
C++ Programm.pptxC++ Programm.pptx
C++ Programm.pptx
 
Sunil
SunilSunil
Sunil
 
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
 
Cs investrigatory project
Cs investrigatory projectCs investrigatory project
Cs investrigatory project
 
DeVry GSP 115 All Assignments latest
DeVry GSP 115 All Assignments latestDeVry GSP 115 All Assignments latest
DeVry GSP 115 All Assignments latest
 
computer project code ''payroll'' (based on datafile handling)
computer project code ''payroll'' (based on datafile handling)computer project code ''payroll'' (based on datafile handling)
computer project code ''payroll'' (based on datafile handling)
 
Opps manual final copy
Opps manual final   copyOpps manual final   copy
Opps manual final copy
 
OOPs manual final copy
OOPs manual final   copyOOPs manual final   copy
OOPs manual final copy
 
4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)
 
Debugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template MetaprogramsDebugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template Metaprograms
 
Machine learning in php singapore
Machine learning in php   singaporeMachine learning in php   singapore
Machine learning in php singapore
 
Simple c program
Simple c programSimple c program
Simple c program
 
Machine learning in PHP
Machine learning in PHPMachine learning in PHP
Machine learning in PHP
 

Recently uploaded

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 

GPA calculator and grading program in c++

  • 1. Computerprogramming1st assignment 1 Name: Taimur Muhammad Class No: 12 Assignment No: 02 Subject: Computer programming Topic: C++ Programming Submitted to: Engineer Durr-e-Nayab Dated: 24-10-2016
  • 2. Computerprogramming1st assignment 2  Creating a GPA Calculatorthat will also find students grades. #include <iostream> usingnamespace std;//usingstandard int main() {int sb1,sb2,sb3,sb4,sb5,chr1,chr2,chr3,chr4,chr5;//declaringintegers cout<<"welcome to u n"; cout<<"Enter the marks of subject 1 n"; cin>>sb1;//it will ask for the marks of subject 1 cout<<"Enter the credit hours of subject 1 n"; cin>>chr1;//it will ask for the credit hours of subject 1 cout<<"Enter the marks of subject 2 n"; cin>>sb2;//it will ask for the marks of subject 1 cout<<"Enter the credit hours of subject 2 n"; cin>>chr2;//it will ask for the credit hours of subject 1 cout<<"Enter the marks of subject 3 n"; cin>>sb3;//it will ask for the marks of subject 1 cout<<"Enter the credit hours of subject 3 n"; cin>>chr3;//it will ask for the credit hours of subject 1 cout<<"Enter the marks of subject 4 n"; cin>>sb4;//it will ask for the marks of subject 1 cout<<"Enter the credit hours of subject 4 n"; cin>>chr4;//it will ask for the credit hours of subject 1
  • 3. Computerprogramming1st assignment 3 cout<<"Enter the marks of subject 5 n"; cin>>sb5;//it will ask for the marks of subject 1 cout<<"Enter the credit hours of subject 5 n"; cin>>chr5;//it will ask for the credit hours of subject 1 double tcrh;//declaringtotal credit hours tcrh=chr1+chr2+chr3+chr4+chr5;//total credit hours formulas double GPA;//declaringGPA GPA=(sb1*chr1+sb2*chr2+sb3*chr3+sb4*chr4+sb5*chr5)/tcrh;//GPA formula cout<<"THIS IS YOUR GPA n"; cout<<GPA;//Gives urGPA char Grade;//declaringcharacter if(GPA>0&&GPA<=20)//applyngdifferent conditionsforgrades {Grade='F'; } else if(GPA>20&&GPA<=40) {Grade='E';} else if(GPA>40&&GPA<=60) {Grade='D';} else if(GPA>60&&GPA<=70) {Grade='C';} else if(GPA>70&&GPA<=80) {Grade='B';} else if(GPA>80&&GPA<=100)
  • 4. Computerprogramming1st assignment 4 {Grade='A';} else Grade='I'; cout<<"n From ur data ,your GRADE is n"; cout<<Grade;//it will give you ur grade return 0; } OUTPUT:- 1; When GPA is b/w 40 and 60 GRADE will be “D”. 2; when GPA is b/w 80 and 100 gives “A” grade.
  • 5. Computerprogramming1st assignment 5 3; when GPA is Greater than 100 grade will be “I” (INVALID). 4; when GPA is between 0 and 20 grade will be “F”. **************************************************************