-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathNotas
More file actions
37 lines (31 loc) · 811 Bytes
/
Copy pathNotas
File metadata and controls
37 lines (31 loc) · 811 Bytes
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
// notafinal.cpp : Defines the entry point for the console application.
// Ejemplo de ciclo repetitivo con contador
#include "stdafx.h"
#include <iostream>
#include "conio.h"
using namespace std;
void main(){
float n,i,a,b,c,d,e,f,g,h,nf;
i=0; // contador
cout << "Ingrese la catidad de notas que quiere calcular: ";
cin >> n;
do {
cout << "Ingrese la nota del primer parcial: ";
cin >> a;
cout << "Ingrese la nota del segundo parcial: ";
cin >> b;
cout << "Ingrese la nota del tercer parcial: ";
cin >> c;
cout << "Ingrese la nota de practicos: ";
cin >> d;
cout << "Ingrese la nota del examen final: ";
cin >> e;
f=((a+b+c)/3)*0.4;
g=(d*0.2);
h=(e*0.4);
nf=(f+g+h);
cout << "La nota final es: "<< nf << endl;
i++; // Incremento del contador
} while (i<n);
getch();
}