main Program: Using Using Using Using Using Using Using Using Namespace Public Partial Class New Public
main Program: Using Using Using Using Using Using Using Using Namespace Public Partial Class New Public
using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms;
namespace actual3 { public partial class Form1 : Form { sub s1 = new sub(); public Form1() { InitializeComponent();
} private void button1_Click(object sender, EventArgs e) { s1.h = int.Parse(textBox1.Text); s1.e = int.Parse(textBox1.Text); s1.hour(); label9.Text = "" + s1.h; label8.Text = "" + s1.h; label7.Text = textBox1.Text; } private void button2_Click(object sender, EventArgs e) { s1.m = int.Parse(textBox2.Text); s1.error(); label15.Text = "" + s1.m; label14.Text = "" + s1.m; label13.Text = textBox2.Text; } private void button3_Click(object sender, EventArgs e) { s1.s = int.Parse(textBox3.Text); s1.error(); label21.Text = "" + s1.s; label20.Text = "" + s1.s; label19.Text = textBox3.Text; } private void button4_Click(object sender, EventArgs e) { s1.add(); s1.hour(); s1.error(); label9.Text = "" + s1.h; label8.Text = "" + s1.h; label7.Text = "" + s1.e; label15.Text = "" + s1.m; label14.Text = "" + s1.m; label13.Text = "" + s1.m; label21.Text = "" + s1.s; label20.Text = "" + s1.s; label19.Text = "" + s1.s; textBox1.Text = "" + s1.h; textBox2.Text = "" + s1.m; textBox3.Text = "" + s1.s; } } }
namespace actual3 { class sub { public int h, m, s, e; public void add() { if (s == 59) { m = m + 1; s = 0; } else { s = s + 1; } if (m > 59) { h = h + 1; m = 0; e = e + 1; } } public void hour() { if (h > 24) { MessageBox.Show("Please enter correct input."); h = 0; } if (h == 13) { h = 1; } if (h == 14) { h = 2; } if (h == 15) { h = 3; } if (h == 16) { h = 4; } if (h == 17) { h = 5; } if (h == 18) {
h } if (h { h } if (h { h } if (h { h } if (h { h } if (h { h } if (h { h }
} public void error() { if (m > 60 || s > 60) { MessageBox.Show("Please enter correct input"); m = 0; s = 0; } } } }
//Main Program
using using using using using System; System.Collections.Generic; System.Linq; System.Text; System.Windows.Forms;
namespace actual3 { class sub { public int h, m, s, e; public void add() { if (s == 59) { m = m + 1; s = 0; } else { s = s + 1; } if (m > 59) { h = h + 1; m = 0; e = e + 1; } } public void hour() { if (h > 24) { MessageBox.Show("Please enter correct input."); h = 0; } if (h == 13) { h = 1; } if (h == 14) { h = 2; } if (h == 15) { h = 3; } if (h == 16) { h = 4; } if (h == 17) { h = 5;
} if (h { h } if (h { h } if (h { h } if (h { h } if (h { h } if (h { h } if (h { h }
== 18) = 6; == 19) = 7; == 20) = 8; == 21) = 9; == 22) = 10; == 23) = 11; == 24) = 12;
} public void error() { if (m > 60 || s > 60) { MessageBox.Show("Please enter correct input"); m = 0; s = 0; } } } }