CST1620 C# / C++ Programming
Lab Week 3


Exercises

Exercise 4.12 (10 points)

Write a C# application that uses looping to print the following table of values:

N 10*N 100*N 1000*N
       
1 10 100 1000
2 20 200 2000
3 30 300 3000
4 40 400 4000
5 50 500 5000

Write this as a windows application.  Put the column data into a ListBox control.

Hint: You will need something like this
listBox1.Items.Add(Convert.ToString(count));
To add your numbers to the list boxes.  Read pages 537 - 538 in Deitel.

  Result (Save to your local machine and run)

Note: Extra credit if you create both 32x32 and 16x16 pixel custom icons for your program. (4 points)

Exercise 4.14 (10 points)

A palindrome is a number or a text phrase that reads the same backwards as forwards.  For example, each of the following five-digit integers are palindromes: 12321, 55555, 45554, and 11611.  Write an application that reads in a five-digit integer and determines whether it is a palindrome.  If the number is not five digits, display an error message dialog indicating the problem to the user.  When the user dismisses the error dialog, allow the user to enter a new value.

  Result (Save to your local machine and run)

Note: Extra credit if you are able to add the OK button to the message box and also have an icon on the message box. (2 points)

Extra credit if you clear the previous palindrome message as soon as you begin entering in a new number. (2 points)