Computer Science 4957/5957
October 20, 2018 / Homework 2 – Pig Latin for Windows / Due: ______

Purpose

With this assignment, you will get some experience using C# to develop a Windows desktop application. The plan is to replace the console driver in the Pig Latin console application with a Windows Forms front end. The following shows one possible initial design of aWindows form on the left and the running application on the right.

Specifications

Create a Windows Forms application and add your PigLatin class from the previous assignment to it. Unless there were flaws in the previous assignment that need to be repaired, you should not have to modify that class in any way. It should be usable as is for this assignment.

While you have some latitude with the design of your form, it should include the information and functionality suggested by the example above. You may use a MenuStrip as an alternative to the buttons shown, for example. The PigLatin class should do all of the string and statistics handling. Your new WindowsForm should handle only the UI,making use of your PigLatin class. It completely replaces the console application driver class from the previous assignment.

Your UI design may use other controls as long as the designated information is presented in a user-friendly and reasonable manner.

Additional Specifications

Use standardwindowscontrols with their associated .NET classes. Sizing, centering, aligning, justifying, and so forth are important in making the application “look” professional.

  • The caption on the running window should be created from the product information and the company information in AssemblyInfo.cs. The version information, likewise, is obtained at runtime from AssemblyInfo.cs. The information in AssemblyInfo.cs should have appropriate values as suggested by the example.
  • The input and output fields on the form are textboxes.
  • Use singlelineormultilinetextboxes as appropriate for each instance.
  • String information should be left-justified and numeric information should be right-justified.
  • Output text boxes should be read-only to prevent the user from typing in them.
  • The Translate button, if used, should be activated when <ENTER> is pressed.
  • The Quit button, if used, should be activated when <ESC> is pressed.
  • Clicking the Translate button should cause the output fields to be filled with information obtained via the PigLatin class. It should also cause all text in the input field to be selected and the focus is left with that input field so that when the user is ready to type a second set of input, the form is ready to go without any “setup” required by the user.
  • Clicking the Clear button should make all input and output fields empty, and it should give the focus to the input field.
  • Clicking the Quit button (or terminating in another way such as clicking the red-X, selecting Close from the systemmenu (the icon in the upper left), clicking ALT-F4, and so forth) should display a MessageBox with a goodbye message and close the window and application.
  • The window should center itself on the screen.
  • The tab order should be appropriate. The focus should be with the input field at the beginning and after each translate or clear. If one tabs away from the input field, the focus should move to each of the three buttons in order and then return to the input field.
  • Don’t use brute force where easier ways exist.
  • Any control, form, or other object that is referenced in the code should have a meaningful name (e.g., btnQuit instead of button3, txtInput instead of TextBox1, and so forth). Likewise, file names, namespace names, and class names should be descriptive instead of generic.
  • When setting fonts, colors, and so forth, remember that your program will not be graded on your computer, so your form should be appropriate on another operating system using a monitor with possible different resolution and other properties.

Deliverable

Zip the entire project folder (without the .exe file) into a file named x957HW2yourname.zip(x is 4 or 5 depending on whether you are in 4957 or 5957) and submit it as an email attachment as you did with the previous assignment. Remember that commenting is important – use the same types of comments as you were supposed to use in the previous assignment.

Homework 2 – Windows FormsPage 1