Advertisement
yoshoo

Untitled

Sep 2nd, 2019
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.80 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.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApp1
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void button1_Click(object sender, EventArgs e)
  21.         {
  22.             if (int.Parse(textBox1.Text) >= 80 && (int.Parse(textBox1.Text) <=100))
  23.             {
  24.                 textBox2.Text = "A";
  25.             }
  26.  
  27.             else if (int.Parse(textBox1.Text) >= 75 && (int.Parse(textBox1.Text) <= 79))
  28.             {
  29.                 textBox2.Text = "B+";
  30.             }
  31.  
  32.             else if (int.Parse(textBox1.Text) >= 70 && (int.Parse(textBox1.Text) <= 74))
  33.             {
  34.                 textBox2.Text = "B";
  35.             }
  36.  
  37.             else if (int.Parse(textBox1.Text) >= 65 && (int.Parse(textBox1.Text) <= 69))
  38.             {
  39.                 textBox2.Text = "C+";
  40.             }
  41.  
  42.             else if (int.Parse(textBox1.Text) >= 60 && (int.Parse(textBox1.Text) <= 64))
  43.             {
  44.                 textBox2.Text = "C";
  45.             }
  46.  
  47.             else if (int.Parse(textBox1.Text) >= 55 && (int.Parse(textBox1.Text) <= 59))
  48.             {
  49.                 textBox2.Text = "D+";
  50.             }
  51.  
  52.             else if (int.Parse(textBox1.Text) >= 50 && (int.Parse(textBox1.Text) <= 54))
  53.             {
  54.                 textBox2.Text = "D";
  55.             }
  56.  
  57.             else if (int.Parse(textBox1.Text) >= 0 && (int.Parse(textBox1.Text) <= 49))
  58.             {
  59.                 textBox2.Text = "E";
  60.             }
  61.  
  62.             else
  63.             {
  64.                 textBox2.Text = "?";
  65.             }
  66.         }
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement