using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp5 { public partial class Form1 : Form { int i=1; bool Answer = false; int happy, sad, indifferent; public Form1() { InitializeComponent(); } private void label2_Click(object sender, EventArgs e) { } private void label1_Click(object sender, EventArgs e) { } private void Next1_Click(object sender, EventArgs e) { i++; if(i==2) { if (Answer) { sad+=2; indifferent++; } else { happy++; } NumberOfQuestion.Text = "Pytanie 2/5"; Question.Text = "Czy jesteś uśmiechnięty?"; } if(i==3) { if (Answer) { happy++; } else { indifferent+=2; sad++; } NumberOfQuestion.Text = "Pytanie 3/5"; Question.Text = "Czy w ostatnich dniach przydarzyło Ci się coś niesamowitego?"; } if (i == 4) { if (Answer) { happy+=3; } else { indifferent++; sad++; } NumberOfQuestion.Text = "Pytanie 4/5"; Question.Text = "Czy w ostatnich dniach uprawiałeś sport?"; } if (i == 5) { if (Answer) { happy+=2; } else { indifferent+=2; sad ++; } NumberOfQuestion.Text = "Pytanie 5/5"; Question.Text = "Czy w ostantich dniach przydarzyło Ci się coś smutnego?"; NextButton.Text = "Podsumowanie"; } if(i==6) { if (Answer == true) { sad += 5; } else { indifferent+=2; sad++; } if(sad>happy&&sad>indifferent) { NumberOfQuestion.Text = "Jesteś smutny! :("; Question.Visible = false; ButtonNie1.Visible = false; ButtonTak1.Visible = false; } else if(happy>sad&&happy>indifferent) { NumberOfQuestion.Text = "Jesteś wesoły! :)"; Question.Visible = false; ButtonNie1.Visible = false; ButtonTak1.Visible = false; } else if(indifferent>happy&& indifferent>sad) { NumberOfQuestion.Text = "Jesteś obojętny :|"; Question.Visible = false; ButtonNie1.Visible = false; ButtonTak1.Visible = false; } } } private void ButtonTak1_CheckedChanged(object sender, EventArgs e) { Answer=true; } private void ButtonNie1_CheckedChanged(object sender, EventArgs e) { Answer = false; } } }