You are on page 1of 1

CS 153 Data Structures I Homework Assignment #1

Instructions:

This assignment is due on Thursday, January 18, 2007. You must demonstrate the creation of this program to the lab TAs.

You are to create a dialog application in Microsoft Visual C++ .NET to accept input for two integers and show the resulting sum. The following steps must be done: 1. Create a new MFC Application project. 2. Delete the automatically created controls in the dialog. 3. Create an Edit Control in the dialog. Associate an int variable with the Edit Control, naming the variable operand1. 4. Create a Static Text control to the right of the operand1 Edit Control. Give it a caption of +. 5. Create another Edit Control to the right of the + Static Text control. Associate an int variable with this Edit Control, naming it operand2. 6. Create a Static Text control to the right of the operand2 Edit Control. Give it a caption of =. 7. Create another Edit Control to the right of the = Static Text control. Associate an int variable with this Edit Control, naming it sum. Also set Read Only to True. 8. Create a Button Control somewhere in the dialog with the caption Add. 9. Assign an appropriate ID to the Add button control. Also set its Default Button property to True. 10. Write an event-handler (which has been given an appropriate function name by the developer, assuming you gave it an appropriate ID) for the Add button such that, when it is clicked, the values in operand1 and operand2 will be added and displayed in the Edit Control for sum. You should then build your solution and run it to demonstrate that it works. Notes: (1) You do not have to comment this program. (2) You can bring a paper copy of this assignment with you to your lab appointment. However, you are not allowed to bring any notes, MFC documentation, cell phone to phone-a-friend, etc. (3) The lab grader will also ask you 2 questions during your demo time to assess your knowledge about this assignment.

You might also like