|Get Selected Weeks Solution with ONLY||NOT||Add Selected Tutorials To Cart|
Lab 2 of 7: Input and Output with Variables
Lab Overview – Scenario / Summary:
TCO 2 - Given a set of program specifications for a simple business problem requiring the use of input and output, code and test a program that meets the specifications and employs best programming practices.
Part A: Basic Input / Output
Step 1: Open a new project
Be sure to have gone over Part A several times before you begin your laboratory assignment. In this part of the lab, you are asked to create a Visual Basic Windows Form application, without providing the specific instructions.
Create a new Windows Forms project in VB. Name your project CIS170A_Lab02_A
Step 2: Program Description
In this project, you will create a Windows Form application that will collect the user’s first name, last name, major, and date of graduation. When the user selects “Display Information” a message box will be displayed that shows the input information and how many days remain before the user graduates from school. [Hint: Check section “Dates as Input and Output” (p. 87-88 in our textbook.)]
Step 3: Suggested form design
You are free to experiment with form design and object colors as you see fit, even though as to colors we strongly recommend using the default colors for the form and all objects – this allows each user to see your form in their chosen Windows color palette.
The suggested form design is as follows:
Here we show some sample data entered in the textboxes and a given date selected in the DateTimePicker.
Note that in the suggested design above we use a DateTimePicker object, which is a very handy way to obtain a date from the user. You have at least two ways to use the date selected by the user:
Use dtpGradDate.Value within your code (that is, the Value property of the DateTimePicker object); or
Apply the Date.TryParse() method to the Text property of the DateTimePicker object: Date.TryParse(Me.dtpGradDate.Text, dtmGradDate)
To compute the number of days between dates, consider using the DateDiff() function. Doubts about this function? Please post question in the Lab Q&A forum in class.
Once you validate all input data and compute your results, consider using a MessageBox.Show() method to display your final message, as follows:
Note that the display above is split into three lines and there are many ways to do this. One of those ways requires inserting vbNewLine in the spot of the display string where you want the line to split. Doubts about this? Please post questions in the Q&A discussion forum in class.
Step 4: Implement the Event Handlers
Consider using the following suggested TOE chart as guide in designing your program’s event handlers:
Compute NumberOfDays between Today and GraduationDate
Set output string to FirstName & “ “ & LastName & “: Major = “ & Major & vbNewLine & “Graduation date = “ & GraduationDate & vbNewLine & “Only “ & NumberOfDays & “ days away!!!”
Display output string
Clear all textboxes & date (today)
Close form [Hint: use “Me.close”]
Please note that beginning this Week 2 you are required to set Option Strict On for all your Labs. To do this, please include the following statement as the first executable statement in your program:
Option Strict On
In addition to this, and also beginning this Week 2 you are required to add profuse internal documentation to your program. Program internal documentation typically consists of:
Identification of the program
Identification of the programmer
List of modifications (including author and date)
Procedure Headers (for each module, event procedure, function, procedure, or segment of code):
Identification of the module
Overall logic (pseudocode)
Interface with the calling program (i.e., parameter list), if used
Calling procedure (event that causes its execution or statements necessary for invoking it), if used
You should include comments within the code itself, for those elements that are a little obscure, or which you think require some explanation.
It is a good idea to write the internal documentation as you progress through the program’s development. Do not leave it all to the last minute or when the application is complete. If you do so, the documentation will most likely be written poorly or not at all. Please note that internal documentation is highly valued in your Labs -- don't leave home without it.
Step 5: Deliverables
Zip up the top-level folder with your program (the complete set of project files) into a single file (please check Doc Sharing for details.)
Rename that .zip file as CIS170A_Lab02_A_LastName_FirstInitial.zip, or similar.
Place deliverables in the Dropbox.
END OF PART A
My solution contain Visual Basic projects.
Please using Visual Studio to open this project.
If you have more question or need help, please contact me via email firstname.lastname@example.org. I will help you any time.