Advertisement
lvm9

Untitled

Oct 11th, 2015
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7. float estatura[10], peso[10];
  8. double imc;
  9. int a,paciente[10], estado;
  10.  
  11. a=0;
  12. do
  13. {
  14. cout <<"Paciente #"<<(a+1)<<endl;
  15. cout <<"Ingresa el numero del paciente (4 digitos)" <<endl;
  16. cin >>paciente[a];
  17. cout <<"Ingresa la estatura del paciente" <<endl;
  18. cin >>estatura[a];
  19. cout <<"Ingresa el peso del paciente" <<endl;
  20. cin >>peso[a];
  21. a=a+1;
  22.  
  23. }while(a<10);
  24.  
  25.  
  26. cout <<setw(8)<<"Paciente"<<setw(12)<<"Estatura"<<setw(7)<<"Peso"<<setw(8)<<"IMC"<<setw(20)<<"Se muestra\n";
  27.  
  28. a=0;
  29. do
  30. {
  31. imc = (peso[a]/(estatura[a]*estatura[a]));
  32.  
  33.  
  34. if(imc < 23)
  35. {
  36. cout<< setw(4)<<paciente[a]<<setw(12)<<estatura[a]<<setw(11)<<peso[a]<<setw(12)<<imc<<setw(15)<<"Desnutricion"<<endl;
  37. }
  38. if(imc >= 23)
  39. {
  40.  
  41. if(imc <=25)
  42.  
  43. {
  44. cout<< setw(4)<<paciente[a]<<setw(12)<<estatura[a]<<setw(11)<<peso[a]<<setw(12)<<imc<<setw(15)<<"Normal"<<endl;
  45. }
  46.  
  47. }
  48. if(imc > 25)
  49. {
  50. cout<< setw(4)<<paciente[a]<<setw(12)<<estatura[a]<<setw(11)<<peso[a]<<setw(12)<<imc<<setw(15)<<"Sobrepeso"<<endl;
  51. }
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. a=a+1;
  64. }while(a<10);
  65.  
  66.  
  67.  
  68.  
  69. return 0;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement