Question: Lab Assignment 7 For this project, youll develop an application that lets the user perform conversion calculations. This application requires a parent form that includes

Lab Assignment 7

For this project, youll develop an application that lets the user perform conversion calculations. This application requires a parent form that includes both a menu and a toolbar, a child form that lets the user calculate conversions, and two additional forms. It also uses two text files, an XML file, two business classes, and two database classes.

Operation

To display an instance of the Conversion form, the user selects the New Conversion command from the File menu or clicks the New button in the toolbar.

To switch to an open Conversion form, the user clicks the form or selects the form from the Window menu.

To close the active Conversion form, the user clicks the Close button or selects the Close command from the File menu.

To change the conversion options, the user clicks the Options button in the toolbar or selects the Options command from the Tools menu to display the Options dialog box.

To arrange the open Conversion forms within the parent form, the user selects the Cascade, Tile Vertical, or Tile Horizontal command from the Window menu.

To perform a conversion, the user selects the conversion to be performed from the combo box list and the application modifies the labels that indicate the from and to lengths accordingly. Then, the user enters the from length and clicks the Calculate button.

Operation

To change the conversion thats displayed by default when a Conversion form is opened, the user

selects the conversion from the Default Conversion combo box.

To determine whether or not the toolbar is displayed, the user checks or unchecks the Show Toolbar

option.

To remove a conversion so its not included in any new Conversion forms that are opened, the user

selects the conversion in the list and then clicks the Remove button.

To add a conversion to any new Conversion forms that are opened, the user clicks the Add button to

display the Add Conversion dialog box.

To restore the default options, the user clicks the Restore Defaults button.

To save all the changes made to the options, the user clicks the OK button. To cancel the changes, the

user clicks the Cancel button.

Operation

To add a conversion, the user enters unit descriptions in the From and To text boxes and a multiplier

that indicates the number of To units in a From unit in the Multiplier text box, and then clicks the OK

button.

Specifications

All user entries should be checked to be sure theyre valid.

When the application starts, the parent form should do the following:

(1) Read the conversion data from a text file named Conversions.txt thats stored in the same

directory as the other project files and store it in an array;

(2) Read the current options from an XML file named Options.xml thats stored in the same

directory as the other project files and store them in an instance of a class named

Options; and

(3) Display one Conversion form.

When a child form is displayed, the application should append a number to the text in its title bar.

If any changes are made to the options, the Options.xml file should be updated.

If conversions are added, removed, or restored, the Conversions.txt file should be updated.

The default conversions are stored in a text file named ConversionsDefault.txt in the same directory as

the other project files. These conversions are as follows:

From To Conversion

Miles Kilometers 1 mile = 1.6093 kilometers

Kilometers Miles 1 kilometer = 0.6214 miles

Feet Meters 1 foot = 0.3048 meters

Meters Feet 1 meter = 3.2808 feet

Inches Centimeters 1 inch = 2.54 centimeters

Centimeters Inches 1 centimeter = 0.3937 inches

The code for working with the Conversions and ConversionsDefault files should be stored in a class

named ConversionsDB. The code for working with the Options file should be stored in a class named

OptionsDB. And the code for validating the user entries should be stored in a class named Validator.

Your finished application should be deployable using one of the three deployment options identified in

chapter 26.

Hints

To refer to the text and XML files in the project directory, you can use this path: ..\..\

This means that the files are two directories above the directory that contains the executable file for

the program, which is usually the bin\Debug directory thats subordinate to the project directory.

To display a list of all the open Conversion windows in the Window menu, you can set the

MdiWindowListItem property of the menu to True.

To display a dialog box in the center of the parent window, you can set the StartPosition property of the

dialog box to CenterParent.

You'll need to read from this text file:

Conversions.txt

Miles|Kilometers|1.6093

Kilometers|Miles|0.6214

Feet|Meters|0.3048

Meters|Feet|3.2808

Inches|Centimeters|2.54

Centimeters|Inches|Centimeters|0.3937

You also need this xml file

Options.xml

0

True

File menu

Tools menu

Window menu

List of files for project

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!