Advertisement
Guest User

Untitled

a guest
May 19th, 2019
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.18 KB | None | 0 0
  1.  
  2. class Time {
  3.  
  4.   String nome;
  5.   int pontos;
  6.  
  7.   void vitoria() {
  8.     pontos = pontos+3;
  9.   }
  10.   void empate() {
  11.     pontos = pontos+1;
  12.  
  13.   }
  14.   void derrota() {
  15.     pontos = pontos+0;
  16.    
  17. import "Ct.dart";
  18. import 'dart:math';
  19. import "dart:io" ;
  20.  
  21. void main() {
  22.  
  23.   Time time1 = Time();
  24.   time1.nome = "Flamengo";
  25.   time1.pontos = 0;
  26.  
  27.   Time time2 = Time();
  28.   time2.nome = "Bahia";
  29.   time2.pontos = 0;
  30.  
  31.   Time time3 = Time();
  32.   time3.nome = "Santos";
  33.   time3.pontos = 0;
  34.  
  35.   Time time4 = Time();
  36.   time4.nome = "Gremio";
  37.   time4.pontos = 0;
  38.  
  39.   Time time5 = Time();
  40.   time5.nome = "Cruzeiro";
  41.   time5.pontos = 0;
  42.  
  43.   Time time6 = Time();
  44.   time6.nome = "Athelico PR";
  45.   time6.pontos = 0;
  46.  
  47.   Random r = new Random();
  48.   var retorno;   //variavel do readLineSync
  49.  
  50.  
  51.   print("Times Cadastrados ${time1.nome} ${time2.nome} ${time3.nome} ${time4.nome} ${time5.nome} ${time6.nome}");
  52.   // como imprimir todos os times sem ter que declarar 1 por um?
  53.  
  54.   retorno = stdin.readLineSync(); // Aperta uma tecla para prosseguir
  55.  
  56.  
  57.  
  58.  //print(time1.pontos);
  59.  //time1.vitoria();
  60.  //print(time1.pontos);
  61.  // time1.vitoria();
  62.  // print(time1.pontos);
  63.  
  64.  
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement