Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace Project
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18.  
  19. private void label1_Click(object sender, EventArgs e)
  20. {
  21.  
  22. }
  23. string questão1 = "Capital de Portugal?";
  24. string resposta1 = "Porto";
  25. string resposta2 = "Lisboa";
  26. string resposta3 = "Braga";
  27. string resposta4 = "Viana do Castelo";
  28. int respostaCorrecta = 2;
  29. string topico1 = "Geografia";
  30. int dificuldade1 = 1; // 1 é mais facil, 3 é mais dificil
  31.  
  32. private void Form1_Load(object sender, EventArgs e)
  33. {
  34.  
  35.  
  36. QuestionLbl.Text = questão1;
  37. Answer1.Text = resposta1;
  38. Answer2.Text = resposta2;
  39. Answer3.Text = resposta3;
  40. Answer4.Text = resposta4;
  41.  
  42.  
  43. // MessageBox.Show("Acabei de carregar");
  44.  
  45. }
  46.  
  47. private void button1_Click(object sender, EventArgs e)
  48. {
  49. int resultado = 0;
  50.  
  51. if (Answer1.Checked)
  52. {
  53. resultado = 1;
  54.  
  55. }
  56. else if (Answer2.Checked)
  57. {
  58. resultado = 2;
  59. }
  60. else if (Answer3.Checked)
  61. {
  62. resultado = 3;
  63. }
  64. else if (Answer4.Checked)
  65. {
  66. resultado = 4;
  67. //MessageBox.Show("Seleccionei 4ªopção);
  68. }
  69.  
  70. if (resultado == respostaCorrecta)
  71. {
  72. MessageBox.Show("Acertou!");
  73. }
  74. else
  75. {
  76. MessageBox.Show("Errou!");
  77. }
  78. MessageBox.Show(resultado.ToString());
  79.  
  80. }
  81.  
  82.  
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement