-
Notifications
You must be signed in to change notification settings - Fork 0
/
teste.cpp
64 lines (61 loc) · 922 Bytes
/
teste.cpp
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
#include<iostream>
#include<string>
using namespace std;
float n1, n2, n3, n4, media, exame;
int i;
string nome;
bool aprovado;
int a[10-0];
int main(){
i = 0;
for(i=0;i<10;i++){
a[i] = i;
cout <<a[i];
cout <<" ";
}
cout <<"Digite o nome do aluno: ";
cin >> nome;
cout <<"" << endl;
i = 0;
while(i<10){
cout <<i;
i = i+1;
cout <<" ";
}
cout <<"" << endl;
cout <<"Calculadora da média!!" << endl;
cout <<"Nota 1: ";
cin >> n1;
cout <<"Nota 2: ";
cin >> n2;
cout <<"Nota 3: ";
cin >> n3;
cout <<"Nota 4: ";
cin >> n4;
media = (n1+n2+n3+n4)/4;
cout <<media << endl;
if(media>=7){
cout <<"" << endl;
aprovado = true;
}else{
aprovado = false;
if(media>=4){
cout <<"Nota Exame: ";
cin >> exame;
media = (media+exame)/2;
if(media>=5){
aprovado = true;
}
}
}
cout <<"Nota Final: ";
cout <<media << endl;
if(aprovado){
cout <<nome;
cout <<"Aprovado" << endl;
}else{
cout <<nome;
cout <<"Reprovado" << endl;
}
return 0;
}