14
MOHAMED YUSSUF BIN JAHUBAR SATHIK (SCM-020140) Contents Program 1...................................................... 2 Design........................................................2 Coding........................................................3 Implement.....................................................5 Program 2...................................................... 6 Design........................................................6 Coding........................................................7 Implement.....................................................8 Program 3...................................................... 9 Design........................................................9 Coding.......................................................10 Implement....................................................12 WINDOWS PROGRAMMING (CIT 3194) Page 1

MOHAMED YUSSUF BIN JAHUBAR SATHIK.docx

Embed Size (px)

Citation preview

MOHAMED YUSSUF BIN JAHUBAR SATHIK (SCM-020140)

MOHAMED YUSSUF BIN JAHUBAR SATHIK (SCM-020140)

ContentsProgram 12Design2Coding3Implement5Program 26Design6Coding7Implement8Program 39Design9Coding10Implement12

Program 1Design

CodingForm1.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;

namespace Login{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void label2_Click(object sender, EventArgs e) {

}

private void button1_Click(object sender, EventArgs e) {

if (textBox1.Text == "yussuf" && textBox2.Text == "1234") { Welcome obj = new Welcome(); obj.Show(); }

else { Wrong obj = new Wrong(); obj.Show(); }

}

private void button2_Click(object sender, EventArgs e) { Close(); }

private void button3_Click(object sender, EventArgs e) { textBox1.Clear(); textBox2.Clear(); } }}Welcome.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;

namespace Login{ public partial class Welcome : Form { public Welcome() { InitializeComponent(); }

private void pictureBox1_Click(object sender, EventArgs e) {

} }}

Wrong.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;

namespace Login{ public partial class Wrong : Form { public Wrong() { InitializeComponent(); } }}

Implement

Program 2Design

Coding

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;

namespace Shape{ public partial class Form1 : Form { public Form1() { InitializeComponent(); }

private void checkBox3_CheckedChanged(object sender, EventArgs e) { checkBox1.Checked = false; checkBox2.Checked = false; rectangleShape1.Visible = checkBox3.Checked; }

private void checkBox1_CheckedChanged(object sender, EventArgs e) { checkBox2.Checked = false; checkBox3.Checked = false; ovalShape1.Visible = checkBox1.Checked; }

private void checkBox2_CheckedChanged(object sender, EventArgs e) { checkBox1.Checked = false; checkBox3.Checked = false; ovalShape2.Visible = checkBox2.Checked; } }}

Implement

Program 3Design

Codingusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;

namespace Student_Detail_Report{ public partial class Form1 : Form { public Form1() { InitializeComponent(); }

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) {

}

private void label7_Click(object sender, EventArgs e) {

}

private void button1_Click(object sender, EventArgs e) { int a = 0, b = 0, c = 0, d = 0, f = 0; string grade; a = int.Parse(textBox4.Text); b = int.Parse(textBox5.Text); c = int.Parse(textBox6.Text); d = a + b + c; textBox7.Text = d.ToString(); f = (a + b + c)/3; textBox8.Text = f.ToString();

if (f >= 85) { textBox9.Text = "A+";

} else if (f >= 75 && f < 85) { textBox9.Text = "A";

} else if (f >= 70 && f < 75) { textBox9.Text = "B+";

} else if (f >= 65 && f < 70) { textBox9.Text = "B";

} else if (f >= 60 && f < 65) { textBox9.Text = "C+";

} else if (f >= 55 && f < 60) { textBox9.Text = "C";

} else if (f >= 50 && f < 55) { textBox9.Text = "D+";

} else if (f >= 40 && f < 50) { textBox9.Text = "D";

} else { textBox9.Text = "Fail"; } }

private void button2_Click(object sender, EventArgs e) { textBox9.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear(); textBox6.Clear(); textBox7.Clear(); textBox8.Clear(); } }}

Implement

WINDOWS PROGRAMMING (CIT 3194)Page 12