Advertisement
joaopaulofcc

Untitled

Aug 18th, 2020
2,231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.67 KB | None | 0 0
  1. import 'dart:io';
  2.  
  3. void main()
  4. {
  5.   const qtdPessoas = 4;
  6.  
  7.     int idade;
  8.   int contPeso90 = 0;
  9.   int somaIdade = 0;
  10.   double peso, media;
  11.  
  12.   for(int i = 1; i <= qtdPessoas; i++)
  13.   {
  14.     print("Digite a idade da $iΒͺ pessoa: ");
  15.     idade = int.parse(stdin.readLineSync());
  16.  
  17.     print("Digite o peso da $iΒͺ pessoa: ");
  18.     peso = double.parse(stdin.readLineSync());
  19.  
  20.     print("\n");
  21.  
  22.     somaIdade = somaIdade + idade;
  23.  
  24.     if(peso > 90)
  25.     {
  26.       contPeso90 = contPeso90 + 1;
  27.     }    
  28.   }
  29.  
  30.   media = somaIdade / qtdPessoas;
  31.  
  32.   print("\n");
  33.  
  34.   print("Quantidade de pessoas com mais de 90Kg: $contPeso90\n");
  35.   print("MΓ©dia das idades: $media");
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement