Assignment 2 ISYS 350.docx - Melissa Tang ISYS 350 02 Assignment 2 Part 1 namespace Assignment_2 public partial class Form1 Form public Form1

Assignment 2 ISYS 350.docx - Melissa Tang ISYS 350 02...

This preview shows page 1 - 4 out of 4 pages.

Melissa TangISYS 350 - 02Assignment 2:Part 1:namespace Assignment_2{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){int seconds, minutes, hours;seconds = int.Parse(textBox1.Text);minutes = seconds / 60;hours = seconds / 3600;if(seconds<60){ MessageBox.Show(seconds + " seconds"); }else if (seconds<3600){ MessageBox.Show(minutes+" minutes,"+(seconds%60)+" seconds"); }else{ MessageBox.Show(hours + " hours, " + (seconds % 3060) / 60 + " minutes, " + (seconds % 3600) % 60 + " seconds"); }}private void textBox1_Validating(object sender, CancelEventArgs e){double number = double.Parse(textBox1.Text);if (number>86400){ MessageBox.Show("The number of seconds cannot exceed 86400"); }}}}
Background image
Melissa TangISYS 350 - 02Part 2:namespace Assignment_2{public partial class Form2 : Form{public Form2(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){double KWHused, electrictycharges;KWHused =
Background image
Background image
Background image

You've reached the end of your free preview.

Want to read all 4 pages?

  • Fall '10
  • LI
  • Hebrew numerals, private void button1, Melissa Tang

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture