You are on page 1of 3

PASTOR ESCOBAR JUAN J.

20140504J
PROBLEMA 1:
#include <iostream>
using namespace std;
int main() {
float R, S, N=3;
/*calculo de resistencia en paralelo*/
R = 0;
S = 0;
for (int i = 1; i <= 3; i++){
cout << "Resistencia " << i << ": ";
cin >> R;
S += 1 / R;
}
cout << "Resistencia equivalente: " <<1/S<<endl;
system("pause");
return 0;
}
PROBLEMA 2:
#include <iostream>
using namespace std;
int main() {
float C, S, N;
/*RESISTENCIAS EN PARALELO*/
cout << "Cantidad de resistencias: ";
cin >> N;
C = 0;
S = 0;
for (int i = 1; i <= N; i++){

cout << "Resistencia " << i << ": ";


cin >> C;
S += 1 / C;
}
cout << "Resistencia equivalente: " <<1/S<<endl;
system("pause");
return 0;
}
PROBLEMA 3:
#include
#include
#include
#include
#include
#include

<iostream>
<string>
<string.h>
<locale.h>
<math.h>
<conio.h>

#include <stdio.h>
#include <windows.h>
using namespace std;
void main() {
setlocale(LC_CTYPE, "spanish");
string nombre1, nombre2, nombre3, nombre4, nombre5;
int i, n, prom1, prom2, prom3, prom4, prom5;
int nota1, cant_notas = 0;
float total_notas = 0;
float total_notas_grupo = 0;
float prom_grupo = 0;
float promedio_notas = 0;
int N,t=0;
float PT=0;
cout << "Ingrese el numero de alumnos : "<<endl;
cin >> N;
for (int p = 0; p < N; p++) {
cout << "Cantidad de cursos de alumno " <<p+1<<" :"<< endl;
cin >> n;
cant_notas = cant_notas + n;
for (i = 1; i <= n; i++) {
cout << "Nota de curso " << i << ":" << endl;
cin >> nota1;
total_notas = total_notas + nota1;
}
promedio_notas = total_notas / n;
total_notas = 0;

PT = PT + promedio_notas;
cout << "Promedio del alumno" << p+1 << " es: " << promedio_nota
s << endl<< endl;
total_notas_grupo = total_notas_grupo + total_notas;
if (promedio_notas >= 10){
t = t + 1;
}
}
cout << "El PT es : " << PT/N<<endl;
cout << "Numero de aprobados : " << t <<endl;
cout << "Numero de desaprobados : " << N-t << endl;
system("pause");
}

You might also like