Get Solved BIS311 Lab 2
Get Solved BIS311 Lab 2
Lab 2 of 7: A Payment Calculator in Visual Basic (40 Points)
Submit your assignment to the Dropbox located on the silver tab at the top of this page.
(See Syllabus “Due Dates for Assignments & Exams” for due dates.)
L A B O V E R V I E W
Scenario and Summary
For this lab, you’ll create a Visual Basic program that implements a payment calculator.
Following the IPO chart and the pseudocode solution below, create a Visual Basic program that accepts a loan amount, a monthly interest rate, and the number of months of the loan. The program should then call a built-in function called PMT that will receive the loan amount, the monthly interest rate, and the number of periods (months) for the loan. PMT calculates the payment on the loan. Then, the program displays the payment to the user, formatted as currency with a dollar sign and cents.
IPO Chart Input: LoanAmount, MonthlyRate, Periods Processing: Calculate the Monthly Payment using the PMT function Output: Monthly Payment
Pseudocode Solution Start Declare Variables Numeric LoanAmount Numeric MonthlyRate Numeric Periods Numeric Payment
Get MonthlyRate, NumPeriods, LoanAmount Payment=PMT(MonthlyRate,Periods,LoanAmount,) Display Payment Stop
Deliverables
Section
Deliverable
Points
Step 10
Lab2YourFirstLastName.docx (Word document) Screenshot of Windows form Copy of button_click event code
40
Category
Points
%
Create a form and rename it.
5
12.5%
Add four labels, three textboxes, and one button to the form.
5
12.5%
Change the properties (name and text) for the above controls.
5
12.5%
Code the button-click event.
15
37.5%
The program runs as intended with the test data shown.
10
25%
Total
40
100%
1. Go to http://lab.devry.edu and log into the Citrix iLab Server as you did last week.
TIP: For more information about logging into the Citrix iLab Server, see the iLab page under Course Home.
2. Launch Visual Studio 2010 by double-clicking its icon on the Citrix iLab menu. (You might have to scroll down on the menu to find the Visual Studio 2010 icon.) You should see a screen similar to this.
L A B S T E P S
STEP 1: Download the Week 1 iLab Instructions
Pull down the File menu and select New Project. Make sure a Windows Forms Application is selected, as shown below. In the Name box, enter Lab2YourFirstnameYourLastname (for example, student John Smith would enter Lab2JohnSmith).
Preparation
Click OK to create the project and enter the Visual Studio Development Environment.
L A B S T E P S
STEP 2
In the Solution Explorer window, right-click on Form1.vb, select Rename, and change the name of the form to Lab2YourFirstnameYourLastname.vb.
L A B S T E P S
STEP 3
If the Toolbox is not visible, click the Toolbox icon on the toolbar to open it.
Then, if necessary, click the pushpin icon at the top of the Toolbox to pin it open.
L A B S T E P S
STEP 4:
Drag four labels, three textboxes, and one button control from the Common Controls area of the Toolbox, and drop them on the form, arranging them as follows.
TIP: If the Common Controls section of the Toolbox is collapsed, click the small plus sign (+) to the left of the section heading to expand it.
L A B S T E P S
STEP 5
Set the properties of each object in the Properties window, as follows.
Control
Property
Setting
Textbox1
Name
txtRate
Textbox2
Name
text months
Textbox3
Name
txtLoanAmount
Label1
Text
Monthly Rate
Label2
Text
Number of Months
Label3
Text
Loan Amount
Button1
Name
btnCalcPayment
btnCalcPayment (was Button1)
Text
Calculate Payment
Label4
Name
lblAnswer
lblAnswer (was Label4)
Text
Payment Will Display Here
Also, click on a blank area of the form to select it, and change the form’s Text property in the Properties window to Lab2YourFirstnameYourLastname.
Expand the Button by clicking on it and dragging its sizing handles.
Your completed form should look similar to this.
L A B S T E P S
STEP 6
With the form in the design view, double-click on the bntCalcPayment Button. This should bring up its click event, called btnCalcPayment_Click( ).
L A B S T E P S
STEP 7
Position your cursor between the Private Sub btnCalcPayment_Click( ) and the End Sub statements. This is where you’ll write your code. Now, enter the following code into the button-click event. The statements with single quotes in front of them are comments that don’t execute; they represent the logical steps that the code must follow and are given as guides.
L A B S T E P S
STEP 8
Click the Start Debugging button on the toolbar to make the program execute.
Remember, if you have errors in your code, you’ll get a message like this.
Click on No and then check the Error List Window at the bottom to debug your programs. Click on the statements with red icons to identify the line that caused the error.
L A B S T E P S
STEP 9
Enter some test values, click the Calculate Payment button, and check that the result is correct. One example of possible inputs and a correct output is shown below.
Note that the Monthly Rate is provided in decimal format.
TIP: If you see error messages or if the program does not run correctly, see the section on Debugging at the end of the Week 1 Lab Instructions. Remember, you can also post in the Q & A Forum or contact your professor for assistance.
L A B S T E P S
STEP 10
Open a Word document and label it. Paste a screenshot of your form and a copy of the button-click event code into the Word document, as you did in Lab 1. Save the Word document as Lab2YourFirstLastName.docx, and submit it to the Week 2 iLab Dropbox.
Also, save your Visual Studio project on the server by clicking the Save All button on the toolbar.
Want Help with Labs?
Get Exam Done provides qualified online tutoring to university students in the State. All aspects of the course, including assignments, discussions, quizzes, and examinations, are covered by our online tutoring service. To assist our university students, we have employed professionals who can handle emergencies. Therefore, regardless of not you are having trouble with a task or paying someone to take a test, we have got your back. Our online tutors work around the clock to complete your assignment and handle any issues you may be having. Our online course provider has fair prices as well. Get our online study assistance now to get started on the path to the grades you want!