Advertisement
AnasB

Dart Quiz Proj

May 13th, 2021 (edited)
572
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import 'dart:io';
  2.  
  3. void main() {
  4.   print('simple quiz game');
  5.   print('enter correct number of answer only number');
  6.   int answer1;
  7.   int answer2;
  8.   int answer3;
  9.   int answer4;
  10.   int answer5;
  11.   int result=0;
  12.   print('whats is capital of kurdistan ?');
  13.   print('1- Erbil.  2- Slimany. 3-Duhok');
  14.   answer1=int.parse(stdin.readLineSync());
  15.   if(answer1==1){print('correct');
  16.   result=result+2;
  17.   }else{print('wrong');}
  18.   print('whats is capital of Canada ?');
  19.   print('1- Yukon.  2- Ontario . 3-Ottawa');
  20.   answer2=int.parse(stdin.readLineSync());
  21.   if(answer2==3){print('correct');
  22.   result=result+2;
  23.   }else{print('wrong');}
  24.   print('whats is capital of USA ?');
  25.   print('1- New York.  2- Nevada. 3- Washington, D.C');
  26.   answer3=int.parse(stdin.readLineSync());
  27.   if(answer3==3){print('correct');
  28.   result=result+2;
  29.   }else{print('wrong');}
  30.   print('whats is capital of UK ?');
  31.   print('1- Manchester.  2- London. 3-Newcastle');
  32.   answer4=int.parse(stdin.readLineSync());
  33.   if(answer4==2){print('correct');
  34.   result=result+2;
  35.   }else{print('wrong');}
  36.   print('whats is capital of Japan ?');
  37.   print('1- Tokyo.  2- Yokohama. 3-Osaka');
  38.   answer5=int.parse(stdin.readLineSync());
  39.   if(answer5==1){print('correct');
  40.   result=result+2;
  41.   }else{print('wrong');}
  42.   print('result : $result/10');
  43.  
  44. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement