-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalculateGPAByDaynamicArrays.cpp
More file actions
71 lines (64 loc) · 1.08 KB
/
CalculateGPAByDaynamicArrays.cpp
File metadata and controls
71 lines (64 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "iostream"
using namespace std;
int main ()
{
int size,x=0;
int *p, *p1;
float *p2;
cout<<"Total Entries: ";
cin>>size;
p= new int[size];
cout<<"\nEnter Mid Marks: "<<endl;
for (int i=1; i<=size; i++)
{
cin>>p[i];
if(p[i]>30)
{
cout<<"Enter Number BeloW 30 !"<<endl;
cin>>p[i];
}
}
p1= new int[size];
cout<<"\nEnter Final Marks: "<<endl;
for (int i=1; i<=size; i++)
{
cin>>p1[i];
if(p1[i]>70)
{
cout<<"Enter Number BeloW 70 !"<<endl;
cin>>p1[i];
}
}
p2= new float[size];
cout<<"\tT.Marks:"<<"\tGPA:"<<"\t\tGrade:"<<"\t\tW&L:";
for (int i=1; i<=size; i++)
{
p2[i]= p[i] + p1[i];
cout<<endl<<"\t"<<p2[i];
if(p2[i]>=87)
{
cout<<"\t\t4.00"<<"\t\tA+";
}
else if(p2[i]>=78)
{
cout<<"\t\t3.50"<<"\t\tA";
}
else if(p2[i]>=72)
{
cout<<"\t\t3.00"<<"\t\tB";
}
else if(p2[i]>=66)
{
cout<<"\t\t2.50"<<"\t\tC";
}
else if(p2[i]>=60)
{
cout<<"\t\t2.00"<<"\t\tD";
}
else
{
cout<<"\t\tFaild..Loser!"<<"\t\tF";
}
}
return 0;
}