You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>BIS</strong> <strong>311</strong> <strong>DeVry</strong> <strong>All</strong> <strong>Week</strong> I Lab<br />
Downloading is very simple, you can download this Course here:<br />
http://mindsblow.us/question_des/<strong>BIS</strong><strong>311</strong><strong>DeVry</strong><strong>All</strong><strong>Week</strong><strong>iLab</strong>/4378<br />
Or<br />
Contact us at:<br />
help@mindblows.us<br />
<strong>BIS</strong> <strong>311</strong> <strong>DeVry</strong> <strong>All</strong> <strong>Week</strong> I Lab<br />
<strong>BIS</strong><strong>311</strong><br />
<strong>BIS</strong> <strong>311</strong> <strong>DeVry</strong> <strong>Week</strong> 1 I Lab<br />
I LAB OVERVIEW<br />
Scenario/Summary<br />
In this <strong>iLab</strong>, you will create a Visual Basic application that meets the following business requirements.<br />
Name Combiner Business Requirements<br />
The application will allow the user to input a person's first name and last name. When the user clicks the Display Name<br />
button, the application will combine the first name, a space, and the last name into the person's full name, and then<br />
display the full name to the user.<br />
The tasks, objects, events (TOE) chart for this application will be as follows.<br />
Task Object Event<br />
Get the following inputs from the user:<br />
First name<br />
Last name<br />
txtFirstName<br />
txtLastName<br />
Perform the following processing:<br />
Form full name by combining first name, a space, and last name btnDisplay Click<br />
Display the following output to the user:<br />
Full name<br />
lblFullName<br />
Deliverables<br />
Submit a single Word document named Lab1YourFirstLastName.docx (where YourFirstLastName = your first and last<br />
name; e.g., JohnSmith) containing the following.<br />
Screenshot of Windows form showing successful operation of the application<br />
Copy of the application's button-click event code<br />
Category Points % Description
Create form, rename it, and set its<br />
7 14%<br />
text property<br />
Add label and text box for first<br />
name, setting name, and text 7 14%<br />
properties for each<br />
Add label and text box for last<br />
name, setting name, and text 7 14%<br />
properties for each<br />
The form is named NameCombiner.vb and has text property set<br />
to Lab1 - Your Name where Your Name = your full name (e.g.,<br />
John Smith).<br />
The label text property is set to First name:. Text box is named<br />
txtFirstName and has text property set to nothing.<br />
The label text property is set to Last name:. The text box is<br />
named txtLastName and has text property set to nothing.<br />
Add labels for full name, setting<br />
name, and text properties for each 7 14% The first label text property is set to Full name:. The second label<br />
is named lblFullName and has text property set to ----------.<br />
Add command button and set its<br />
7 14%<br />
name and text properties<br />
Code button-click event 7 14%<br />
Program tested and runs as<br />
8 16%<br />
required<br />
The command button is named btnDisplay and has text property<br />
set to Display Name.<br />
The code in the button-click event declares two String variables<br />
for first, last, and full names; gets the values entered in the text<br />
boxes by the user into the corresponding variables; concatenates<br />
the first name, a space, and the last name, storing the result in<br />
the full name variable; and displays the full name in the<br />
appropriate label.<br />
A screenshot displays the form after the user has entered a first<br />
name and a last name and clicked the Display Name button. The<br />
corresponding first name, space, and last name are displayed in<br />
the output label.<br />
Total 50 100%<br />
Required Software<br />
Visual Studio 2012<br />
Access the software at.devry.edu">https://lab.devry.edu.<br />
Steps: all<br />
iLAB STEPS<br />
STEP 1: Launch and Configure Microsoft Visual Studio 2012<br />
.equella.ecollege.com/file/8fe38950-b7ec-4492-8803-a1c7312a7eb1/67/<strong>BIS</strong><strong>311</strong>_W1_<strong>iLab</strong>.html#top">Back to Top<br />
(a) On the Citrix <strong>iLab</strong> main screen, if the Visual Studio 2012 icon is not already displayed, click the plus sign (+) on the<br />
left side of the screen. Next, click on <strong>All</strong> Apps and scroll down to find Microsoft Visual Studio 2012. Click on it to add it<br />
to your Citrix <strong>iLab</strong> menu screen.<br />
(b) On the Citrix <strong>iLab</strong> main menu screen, click the Microsoft Visual Studio 2012 icon to launch the applicatio<br />
STEP 2: Create the Project<br />
.equella.ecollege.com/file/8fe38950-b7ec-4492-8803-a1c7312a7eb1/67/<strong>BIS</strong><strong>311</strong>_W1_<strong>iLab</strong>.html#top">Back to Top<br />
(a) Pull down the File menu and select New Project.<br />
(b) In the New Project dialog box, ensure that the Visual Basic and Windows Form Application choices are selected.<br />
Change the name in the Name box at the bottom of the dialog box to NameCombiner. Click OK.<br />
(c) A blank form for your application should now be displayed as shown below.<br />
STEP 3: Set Up Main Form<br />
.equella.ecollege.com/file/8fe38950-b7ec-4492-8803-a1c7312a7eb1/67/<strong>BIS</strong><strong>311</strong>_W1_<strong>iLab</strong>.html#top">Back to Top
(a) Under Solution Explorer on the right side, right-click on Form1.vb and select Rename. Change the name to<br />
NameCombiner.vb and press Enter. The result should look like the following.<br />
(b) If the Properties window is not already displayed below the Solution Explorer window at the bottom right of the<br />
screen, click the Wrench icon on the Solution Explorer toolbar to display it.<br />
(c) Click the blank form in the NameCombiner.vb [Design] tab on the left side of the screen to select it. The form's<br />
properties should now be displayed in the Properties window at the bottom right. Scroll through the list to find the Text<br />
property row. Change the property for the text from Form1 to Lab1 - Your Name where Your Name = your first and last<br />
names (e.g., John Smith).<br />
STEP 4: Add Form Controls<br />
.equella.ecollege.com/file/8fe38950-b7ec-4492-8803-a1c7312a7eb1/67/<strong>BIS</strong><strong>311</strong>_W1_<strong>iLab</strong>.html#top">Back to Top<br />
(a) If the Toolbox pane is not opened on the left side of the screen, click the Toolbox tab at the center left edge of the<br />
screen to open it. Click the Pushpin symbol at the right side of the Toolbox title bar to pin the Toolbox in the open<br />
position.<br />
(b) Click the Common Controls heading in the Toolbox to expand it. Under Common Controls, select the Label control<br />
and drag it onto the form, positioning it in the upper left area. In the Properties window, select the Text property of the<br />
label and change it to First name:. Press Enter and you should see the new text appear in the label.<br />
(c) Drag a TextBox control from the Common Controls area of the Toolbox and position it directly underneath the First<br />
name: label. Note: You may have to scroll down in the list of controls to find the TextBox control. Next, in the Properties<br />
window, change the (Name) property to txtFirstName. Ensure that the Text property is empty (blank).<br />
(d) Drag another Label control from the Toolbox and position it in the upper right area of the form. Change its Text<br />
property to Last name:.<br />
(e) Drag another TextBox control from the Toolbox and position it directly underneath the Last name: label. Change its<br />
(Name) property to txtLastName and ensure that its Text property is empty (blank).<br />
(f) Drag another Label control from the Toolbox and position it in the center of the form below the text boxes. Change<br />
its Text property to Full name:.<br />
(g) Drag another Label control from the Toolbox and position it directly underneath the Full name: label. Change its<br />
(Name) property to lblFullName and its Text property to ---------- (10 dashes).<br />
(h) Drag a Button control from the Toolbox and position it in the center of the form near the bottom. Change its (Name)<br />
property to btnDisplay and its Text property to Display Name. If necessary, click and drag the sizing handles (small<br />
circles) at the edges of the button to make it larger so that the complete text can be seen in the button.<br />
(i) Verify that your form looks similar to the following, and make any necessary adjustments to the positions and<br />
properties of the controls.<br />
STEP 5: Code Button-Click Event<br />
.equella.ecollege.com/file/8fe38950-b7ec-4492-8803-a1c7312a7eb1/67/<strong>BIS</strong><strong>311</strong>_W1_<strong>iLab</strong>.html#top">Back to Top<br />
(a) Double-click the Display Name button on the form. This will open the code editor with a stub or template for the<br />
button-click event handler procedure already generated for you by Visual Studio.<br />
(b) Starting where the cursor is positioned, in between the line beginning Private Sub btnDisplay_Click( . . . and the line<br />
End Sub, enter the following code.<br />
Code for Button-Click Event<br />
'Display full name<br />
Dim strFirstName As String<br />
Dim strLastName As String<br />
Dim strFullName As String<br />
strFirstName = txtFirstName.Text<br />
strLastName = txtLastName.Text
strFullName = strFirstName + " " + strLastName<br />
lblFullName.Text = strFullName<br />
After you have entered your code, the code editor window should look as follows.<br />
(c) Pull down the File menu and select Save <strong>All</strong> to save your changes to the project. If a Save Project dialog appears,<br />
ensure that the project is being saved to the My DocumentsVisual Studio 2012Projects folder under your DSI number.<br />
Click Save.<br />
STEP 6: Test, Debug, and Submit<br />
.equella.ecollege.com/file/8fe38950-b7ec-4492-8803-a1c7312a7eb1/67/<strong>BIS</strong><strong>311</strong>_W1_<strong>iLab</strong>.html#top">Back to Top<br />
(a) Run the application by doing one of the following: click the Start button (green, right-pointing, triangle icon) on the<br />
toolbar; pull down the Debug menu and select Start Debugging; or press the F5 key.<br />
(b) Your form should appear. Enter your first name in the First name text box and your last name in the Last name text<br />
box. Then click the Display Name button. Your first and last name should appear under Full name with a space between<br />
them, as shown below.<br />
(c) If you received an error message or your application did not work correctly, don't despair; debugging is a natural<br />
part of the programming process. Review your code and the naming of your controls carefully, and find and correct the<br />
errors. Then try running the application again. If you get stuck, you can post in the Q & A Forum or contact your<br />
professor for assistance.<br />
(d) When your application runs and works correctly, capture a screenshot of the form with your first and last name<br />
entries and correct full name displayed. Note: To capture a screenshot of the current window, press the Ctrl, Alt, and<br />
PrintScreen keys simultaneously; this will copy an image of the current window into your copy-and-paste buffer. Next,<br />
open a Word document and paste your image into the document. Close the application form by clicking the X in the<br />
upper right corner. Now select and copy your Visual Basic code for the button-click event in the code editor, and paste<br />
this into the Word document as well. Save the Word document as Lab1YourFirstLastName.docx (where<br />
YourFirstLastName = your first and last name, e.g., JohnSmith) and submit it to the appropriate Dropbox.<br />
<strong>BIS</strong> <strong>311</strong> <strong>DeVry</strong> <strong>Week</strong> 2 <strong>iLab</strong><br />
iLAB OVERVIEW<br />
Scenario/Summary<br />
In this <strong>iLab</strong> assignment, you will create a Visual Basic application that implements a loan payment calculator, based on<br />
the business requirements, TOE chart, and pseudocode shown below.<br />
Payment Calculator Business Requirements<br />
The application will accept as inputs a loan amount, an annual interest rate, and the number of years for the loan. The<br />
application will calculate the monthly payment amount for the loan. As output, the application will display to the user<br />
the monthly payment amount formatted as currency with a dollar sign and cents.<br />
Payment Calculator TOE Chart<br />
Task Object Event<br />
Get the following inputs from the user.<br />
Loan amount<br />
Annual interest rate<br />
Number of years<br />
txtLoanAmount<br />
txtAnnualRate<br />
txtYears<br />
Perform the following processing.<br />
Calculate the monthly payment using the Pmt function btnCalcPayment Click
Display the following output to the user.<br />
Monthly payment formatted as currency with $ and cents<br />
lblMonthlyPayment<br />
Pseudocode for Payment Calculator Application<br />
Start<br />
Declare numeric variables for<br />
Loan amount<br />
Annual rate<br />
Years of loan<br />
Monthly payment<br />
Get inputs:<br />
Loan amount<br />
Annual rate<br />
Years of loan<br />
Calculate Monthly payment =-PMT(Annual rate /12,Years of loan *12,Loan amount)<br />
Display Monthly payment formatted as currency with $ and cents<br />
Stop<br />
Deliverables<br />
Submit a Word document named Lab2YourFirstLastName.docx(where YourFirstLastName = your first and last name;<br />
e.g., Lab2JohnSmith.docx) containing the following.<br />
Screenshot of the form showing the application running, with correct input and output values displayed in the form<br />
Copy of button-click event code<br />
Category Points % Description<br />
Create and rename form 10 20%<br />
Add controls to form 10 20%<br />
Set properties (name and<br />
10 20%<br />
text) for controls<br />
Code button-click event 10 20%<br />
A Windows form was created and named PaymentCalculator.vb. The<br />
form text property was set to Lab 2 Your Name (where Your Name =<br />
your full name).<br />
The following controls were added to the form: identifying labels and<br />
text boxes for entry of loan amount, annual rate, and years of loan;<br />
Calculate Payment button; and label for display of payment amount.<br />
Controls are arranged on the form in a logical and visually pleasing<br />
layout.<br />
Name and text properties of all controls were set appropriately, with no<br />
typos or spelling errors.<br />
Button-click event code was entered that corresponds to the given<br />
pseudocode, with no syntax errors.<br />
Test-run<br />
successfully<br />
application<br />
10 20%<br />
The application is shown running successfully with no errors, with valid<br />
inputs and correct output displayed in the form.<br />
Total 50 100%<br />
Required Software
Microsoft Visual Studio 2012<br />
Access the software at.devry.edu">https://lab.devry.edu.<br />
iLAB STEPS<br />
STEP 1: Launch Visual Studio<br />
.equella.ecollege.com/file/bfe9e5e5-c91c-450f-a8b4-b45a9d02faa3/40/<strong>BIS</strong><strong>311</strong>_W2_<strong>iLab</strong>.html#top">Back to Top<br />
Log in to the Citrix <strong>iLab</strong> site as you did in the previous week's <strong>iLab</strong>. The Microsoft Visual Studio 2012 icon should<br />
already be displayed on your Citrix main menu page. Click the Microsoft Visual Studio 2012 icon to launch Visual<br />
Studio.<br />
You should see a screen similar to the following.<br />
STEP 2: Create Project<br />
.equella.ecollege.com/file/bfe9e5e5-c91c-450f-a8b4-b45a9d02faa3/40/<strong>BIS</strong><strong>311</strong>_W2_<strong>iLab</strong>.html#top">Back to Top<br />
(a) Pull down the File menu and select New Project . . . .<br />
(b) In the New Project dialog, ensure that in the left column, under Templates, Visual Basic is selected; and that in the<br />
center column, Windows Form Application is selected. In the Name field at the bottom of the dialog, enter<br />
PaymentCalculator. Click OK.<br />
(c) A project with a blank form should be displayed, as shown below.<br />
STEP 3: Rename Form<br />
.equella.ecollege.com/file/bfe9e5e5-c91c-450f-a8b4-b45a9d02faa3/40/<strong>BIS</strong><strong>311</strong>_W2_<strong>iLab</strong>.html#top">Back to Top<br />
(a) In the Solution Explorer pane on the right side of the screen, right-click on Form1.vb, select Rename, and change<br />
the name to PaymentCalculator.vb. Press Enter after entering the new form name.<br />
(b) Click on the form in the center Design pane to select it. In the Properties pane at the bottom right of the screen,<br />
change the Text property of the form to Lab 2 Your Name where Your Name = your full name. Remember, you may<br />
need to scroll in the Properties pane to find the Text property.<br />
STEP 4: Add Controls to Form<br />
.equella.ecollege.com/file/bfe9e5e5-c91c-450f-a8b4-b45a9d02faa3/40/<strong>BIS</strong><strong>311</strong>_W2_<strong>iLab</strong>.html#top">Back to Top<br />
(a) Check that the Toolbox is displayed at the left side of the screen. If it is not, click the Toolbox tab at the center left<br />
edge of the screen to expand the Toolbox, and click the pushpin symbol at the right side of the Toolbox title bar to pin<br />
it open.<br />
(b) If necessary, click the Common Controls heading in the Toolbox to expand it. Drag four Label controls, three TextBox<br />
controls, and one Button control from the Common Controls area of the Toolbox onto the form, and arrange them on<br />
the form as shown below.<br />
(c) If you received an error message, or if your application did not work correctly, apply the methods for finding and<br />
fixing programming errors described in the reading assignment to debug your application. Post in the Q & A Forum or<br />
contact your professor for assistance if needed.<br />
(d) When your application runs and works correctly, capture a screenshot of the form showing the input and output<br />
values given above. Remember, use Ctrl+Alt+PrintScreen to capture a screenshot. Paste your screenshot image into<br />
a Word document. Select and copy your code for the button-click event and also paste this into the Word document.<br />
Save the Word document as Lab2YourFirstLastName.docx (where YourFirstLastName = your first and last name; e.g.,<br />
JohnSmith) and submit it to the appropriate Dropbox<br />
<strong>BIS</strong> <strong>311</strong> <strong>DeVry</strong> <strong>Week</strong> 3 <strong>iLab</strong><br />
iLAB OVERVIEW<br />
Scenario/Summary
In this lab, you will implement a tax calculator application that meets the following business requirements:<br />
Tax Calculator Business Requirements<br />
The application will accept as inputs the individual's income and number of dependents. The application will calculate<br />
the individual's total deductions as a standard deduction of $6,000 plus a deduction of $1,000 per dependent. The<br />
application will calculate the individual's adjusted gross income as the income minus the total deductions. The<br />
application will then calculate the tax owed using the following tax table.<br />
Adjusted Gross Income<br />
Tax<br />
Less than or equal to $10,000 Adjusted gross income × 10%<br />
Greater than $10,000 and less than or equal to $40,000<br />
Greater than $40,000 and less than or equal to $100,000<br />
Greater than $100,000<br />
$1,000 + (Adjusted gross income -<br />
$10,000) × 15%<br />
$5,500 + (Adjusted gross income -<br />
$40,000) × 25%<br />
$20,500 + (Adjusted gross income -<br />
$100,000) × 35%<br />
As output, the application will display to the user the tax owed, formatted as currency with a dollar sign and cents.<br />
Tax Calculator TOE Chart:<br />
Task Object Event<br />
Get the following inputs from the user:<br />
Check amount<br />
Number of dependents<br />
txtIncome<br />
txtDependents<br />
Perform the following processing: btnCalcTax Click<br />
Calculate total deductions = 6000 + Number of dependents × 1000<br />
Calculate adjusted gross income = Income - Total deductions<br />
Calculate tax owed using tax table in requirements<br />
Display the following output to the user:<br />
Tax owed formatted as currency with $ and cents<br />
lblTaxOwed<br />
Pseudocode for Tax Calculator Application<br />
Start<br />
Declare numeric constants for<br />
Standard deduction =6000<br />
Dependent deduction =1000<br />
Income bracket 1=10000<br />
Rate1=0.10<br />
Income bracket 2=40000<br />
Base2=1000<br />
Rate2=0.15
Income bracket 3=100000<br />
Base3=5500<br />
Rate3=0.25<br />
Base4=20500<br />
Rate4=0.35<br />
Declare numeric variables for<br />
Income<br />
Number of dependents<br />
Total deductions<br />
Adjusted gross income<br />
Tax owed<br />
Get inputs:<br />
Income<br />
Number of dependents<br />
Calculate Total deductions =Standard deduction +(Number of dependents *Dependent deduction)<br />
Calculate Adjusted gross income =Income-Total deductions<br />
If Adjusted gross income is less than or equal to Income bracket 1 Then<br />
CalculateTax owed =Adjusted gross income * Rate 1<br />
Else If Adjusted gross income is less than or equal to Income bracket 2<br />
Calculate Tax owed =Base 2 + (Adjusted gross income - Income bracket 1) * Rate 2<br />
Else If Adjusted gross income is less than or equal to Income bracket 3<br />
Calculate Tax owed =Base3 + (Adjusted gross income - Income bracket 2) * Rate 3<br />
Else<br />
Calculate Tax owed = Base 4 + (Adjusted gross income -Income bracket 3) * Rate 4<br />
End If<br />
Display Tax owed formatted as currency with $ and cents<br />
Stop<br />
NOTE: The above is a simplified version of tax calculations for purposes of this lab. Although the basic principles of a<br />
graduated income tax are illustrated here, real taxes are more complicated, and the rates and brackets are different.<br />
Please do not use this simple application to calculate your real taxes.<br />
Deliverables<br />
Submit a Word document named Lab3YourFirstLastName.docx (where YourFirstLastName = your first and last name;<br />
e.g., Lab3JohnSmith.docx) containing the following:<br />
Screenshots of form showing the application running, with the following correct input and output values displayed in<br />
the form.<br />
Income = 9,000, Number of dependents = 1, Tax owed = $200.00<br />
Income = 25,000, Number of dependents = 2, Tax owed = $2,050.00<br />
Income = 70,000, Number of dependents = 3, Tax owed = $10,750.00
Income = 150,000, Number of dependents = 4, Tax owed = $34,500.00<br />
Copy of button-click event code<br />
Category Points % Description<br />
Create and rename form 5 10%<br />
Add controls to form 5 10%<br />
Set properties (name and text)<br />
5 10%<br />
for controls<br />
Code button-click event 15 30%<br />
Windows form was created and renamed TaxCalculator.vb. Form<br />
text property was set to Lab 3 Your Name (where Your Name =<br />
your full name).<br />
The following controls were added to the form: Identifying labels<br />
and text boxes for entry of income and number of dependents;<br />
Calculate Tax button; and label for display of tax owed. Controls<br />
are arranged on form in a logical and visually pleasing layout.<br />
Name and text properties of all controls were set appropriately,<br />
with no typos or spelling errors.<br />
Button-click event code was entered that corresponds to the given<br />
pseudocode, with no syntax errors.<br />
Test-run<br />
successfully<br />
application<br />
20 40%<br />
Application is shown running successfully with no errors, with valid<br />
inputs and correct output for each of the four specified test cases.<br />
Total 50 100%<br />
Required Software<br />
Log in to the Citrix <strong>iLab</strong> site as you did in the previous labs. The Microsoft Visual Studio 2012 icon should be displayed<br />
already on your Citrix main menu page. Click the Microsoft Visual Studio 2012 icon to launch Visual Studio.<br />
(a) Pull down the File menu and select New Project . . . .<br />
(b) In the New Project dialog, ensure that in the left column, under Templates, Visual Basic is selected; and that in the<br />
center column Windows Form Application is selected. In the Name field at the bottom of the dialog, enter TaxCalculator.<br />
Click OK. (<br />
(a) Drag the following controls from the ToolBox onto the form, arrange them in a logical fashion, and set their properties<br />
as indicated in the table below.<br />
Control Name Property Text Property<br />
Label Label1 Income:<br />
TextBox<br />
txtIncome<br />
Label Label2 Number of dependents:<br />
TextBox<br />
txtDependents<br />
Button btnCalcTax Calculate Tax Owed<br />
Label lblTaxOwed Your tax owed will display here<br />
(b) Ensure that all controls are positioned and sized so that the form has a neat, professional appearance and none of<br />
the text is cut off. Your completed form should look similar to the following.<br />
(c) Your form should appear. Test your application using the following test cases. For each test case, enter the indicated<br />
values for Income and Number of dependents; click the Calculate Tax button; and check that the amount displayed for<br />
the tax owed is correct. Capture a screenshot showing the results of each correct test case and paste into a Word<br />
document. Remember, use CTRL+ALT+PrintScreen to capture a screenshot.<br />
Test case # Income Number of dependents Tax owed
1 9,000 1 $200.00<br />
2 25,000 2 $2,050.00<br />
3 70,000 3 $10,750.00<br />
4 150,000 4 $34,500.00<br />
For example, the screenshot for test case #1 should look as follows:<br />
(c) If you receive an error message or your application did not work correctly, debug the application and try again. Post<br />
in the Q & A Forum or contact your professor for assistance if needed.<br />
(d) When your application works correctly for all the test cases, select and copy the code for the button-click event and<br />
paste it into your Word document below the four test case screenshots. Save the Word document containing the four<br />
test case screenshots and your button-click event code asLab3YourFirstLastName.docx (where YourFirstLastName =<br />
your first an<br />
<strong>BIS</strong> <strong>311</strong> <strong>DeVry</strong> <strong>Week</strong> 4 <strong>iLab</strong><br />
iLAB OVERVIEW<br />
Scenario/Summary<br />
In this lab, you will implement a grade calculator application that meets the following business requirements:<br />
Grade Calculator Business Requirements<br />
The user types the number of grades he or she wishes to enter in a text box. When the user clicks a button, the<br />
application enters a loop that accepts the specified number of grades and totals them up. The application then displays<br />
the entered grades and their average, formatted to two decimal places.<br />
Grade Calculator TOE Chart<br />
Task Object Event<br />
Get the following inputs from the user:<br />
Number of grades to enter<br />
Each grade<br />
txtNumGrades<br />
Input box<br />
Perform the following processing: btnCalcAvgGrade Click<br />
Add up the total of all grades<br />
Divide the total by the number of grades to calculate the average<br />
Display the following outputs:<br />
Each grade<br />
Average grade formatted with two decimal places<br />
txtGrades<br />
lblAverage<br />
Pseudocode for Grade Calculator Application<br />
Start<br />
Declare numeric constant for Maximum number of grades =100<br />
Declare numeric variables for:<br />
Number of grades
Grade<br />
Total of grades (initialize to 0)<br />
Average grade<br />
Declare numeric array GradeArray able to hold the Maximum number of grades<br />
Get the Number of grades<br />
Repeat for each grade up to Number of grades<br />
Get the Grade<br />
Store the Grade in the GradeArray array<br />
Add the Grade to the Total of grades<br />
End Repeat<br />
Calculate Average grade =Total of grades/Number of grades<br />
Repeat for each GradeArray element up to Number of grades<br />
Display the GradeArray element<br />
End Repeat<br />
Display the Average grade formatted with two decimal places<br />
Stop<br />
Deliverables<br />
Submit a Word document named Lab4YourFirstLastName.docx (where YourFirstLastName = your first and last name;<br />
e.g., Lab4JohnSmith.docx) containing the following:<br />
<br />
<br />
Screenshot of form showing the application running, with 10 grades entered and displayed along with the<br />
correct average.<br />
Copy of button-click event code<br />
Category<br />
Step 2: Rename Form and Add Controls<br />
.equella.ecollege.com/file/9c975e7b-3ccf-4cf6-9005-6cf86e077540/34/<strong>BIS</strong><strong>311</strong>_W4_<strong>iLab</strong>.html#top">Back to Top<br />
(a) In the Solution Explorer pane on the right side of the screen, right-click on Form1.vb, select Rename, and change<br />
the name to GradeCalculator.vb. Press Enter after entering the new form name.<br />
(b) Change the Text property of the form to Lab 4 Your Name (where Your Name = your full name), as you have done<br />
in previous labs.<br />
(c) Drag the following controls from the ToolBox onto the form, arrange them in logical fashion, and set their properties<br />
as indicated in the table below:<br />
Control Name Property Text Property<br />
Multiline<br />
Property<br />
ScrollBars<br />
Property<br />
ReadOnly<br />
Label Label1 Enter number of grades:<br />
TextBox<br />
Button<br />
txtNumGrades<br />
btnCalcAvgGrade<br />
Get Grades and Calculate<br />
Average<br />
Label Label2 Grades entered:
TextBox txtGrades True Vertical True<br />
Label lblAverage Average will display here<br />
(d) Ensure that all controls are positioned and sized so that the form has a neat, professional appearance and none of<br />
the text is cut off. Your completed form should look similar to the following.<br />
Step 3: Code Button-Click Event<br />
.equella.ecollege.com/file/9c975e7b-3ccf-4cf6-9005-6cf86e077540/34/<strong>BIS</strong><strong>311</strong>_W4_<strong>iLab</strong>.html#top">Back to Top<br />
(a) Double-click the button on the form to open the code editor with a template for the button-click event procedure.<br />
(b) Starting where the cursor is positioned, in between the line beginning Private Sub btnCalcAvgGrade_Click( . . . and<br />
the line End Sub, enter the following code.<br />
Code for Button-Click Event<br />
'Get grades and calculate average<br />
'Declare constants and variables<br />
Const intMAX_NUM_GRADES As Integer = 100<br />
Dim intNumGrades As Integer<br />
Dim intGrade As Integer<br />
Dim intTotal As Integer = 0<br />
Dim dblAverage As Double<br />
Dim intGradeArray(intMAX_NUM_GRADES - 1) As Integer<br />
'Get the number of grades<br />
Integer.TryParse(txtNumGrades.Text, intNumGrades)<br />
'Loop to accept grades and add up total<br />
For intGradeNumber As Integer = 1 To intNumGrades<br />
Integer.TryParse(InputBox("Enter grade #" & intGradeNumber), intGrade)<br />
intGradeArray(intGradeNumber - 1) = intGrade<br />
intTotal += intGrade<br />
Next intGradeNumber<br />
'Calculate average grade<br />
dblAverage = intTotal / intNumGrades<br />
'Loop to display each grade entered<br />
For intGradeNumber As Integer = 1 To intNumGrades<br />
txtGrades.Text += "Grade #" & intGradeNumber & " = " & intGradeArray(intGradeNumber - 1) & vbCrLf<br />
Next intGradeNumber<br />
'Display average<br />
lblAverage.Text = "The average grade is " & Format(dblAverage, "Standard")<br />
The code editor window should look like the following after you have entered your code.<br />
Step 4: Test, Debug, and Submit<br />
.equella.ecollege.com/file/9c975e7b-3ccf-4cf6-9005-6cf86e077540/34/<strong>BIS</strong><strong>311</strong>_W4_<strong>iLab</strong>.html#top">Back to Top
(a) Run the application by doing one of the following: click the Start button; pull down the Debug menu and select Start<br />
Debugging; or press the F5 key.<br />
(b) Your form should appear. Test your application by entering the value 10 as the number of grades and clicking the<br />
Start button. An input box should appear, prompting you to enter a grade. Enter the first grade from the list of test data<br />
below and click the OK button in the input box. Continue entering the test grades, clicking OK after each one, until all<br />
grades have been entered.<br />
Grade #<br />
Grade<br />
1 60<br />
2 93<br />
3 89<br />
4 61<br />
5 60<br />
6 70<br />
7 85<br />
8 76<br />
9 76<br />
10 92<br />
During the grade entry process, your screen should look like the following.<br />
(c) After you enter the last grade, the application should display all the grades and the average. Your screen should<br />
look as follows:<br />
(d) If you receive an error message or your application does not work correctly, debug the application and try again.<br />
Post in the Q & A Forum or contact your professor for assistance if needed.<br />
(e) When your application works correctly, capture a screenshot of the form showing the 10 grades entered and the<br />
average, and paste it into a Word document. Remember, use CTRL+ALT+PrintScreen to capture a screenshot. Also<br />
select and copy your button-click event code and paste it into the Word document. Save the Word document<br />
asLab4YourFirstLastName.docx (where YourFirstLastName = your first and last name; e.g., JohnSmith) and submit it<br />
to the appropriate dropbox.<br />
<strong>BIS</strong> <strong>311</strong> <strong>DeVry</strong> <strong>Week</strong> 5 <strong>iLab</strong><br />
iLAB OVERVIEW<br />
Scenario/Summary<br />
In this lab, you'll implement an application that performs a simple sales tax calculation. The new feature of this<br />
application, compared to what you have done in previous <strong>iLab</strong>s, is that the values entered by the user will be checked<br />
for validity. If the amounts entered are invalid, the application will display appropriate error messages to the user. If the<br />
input data are valid, the application will calculate the sales tax due and the total, including tax.<br />
Sales Tax Application Business Requirements<br />
The user enters an order amount and a sales tax percent. The order amount must be numeric and greater than 0. The<br />
sales tax percent must be numeric, greater than or equal to 0, and less than or equal to 0.14. If the input data are<br />
invalid, appropriate error messages will be displayed to the user. If the input data are valid, the application will calculate<br />
the sales tax by multiplying the order amount by the sales tax percent, and will calculate the order total, including tax,<br />
by adding the order amount and the sales tax. The sales tax and the order total, including tax, will be displayed to the<br />
user.
TOE Chart for Sales Tax Application<br />
Task Object Event<br />
Get the following inputs from the user:<br />
Order amount<br />
Sales tax percent<br />
txtOrderAmount<br />
txtTaxPercent<br />
Perform the following processing: btnCalcTotal Click<br />
Validate inputs<br />
Calculate Tax = Order amount * Sales tax percent<br />
Calculate Order total = Order amount + Tax<br />
Display the following outputs:<br />
Error messages (if input invalid)<br />
Tax (if input valid)<br />
Order total (if input valid)<br />
lstMessages<br />
lstMessages<br />
lstMessages<br />
Pseudocode for Sales Tax Application<br />
Start button-click event handler<br />
Declare numeric variables for<br />
Order amount<br />
Sales tax percent<br />
Tax<br />
Order total<br />
Declare string variables for<br />
Order amount message<br />
Sales tax percent message<br />
Declare Boolean variable for<br />
Inputs valid (initialize to True)<br />
Clear messages<br />
Call ValidateOrderAmount function with Order amount, returning Order amount message<br />
If Order amount message is not empty (i.e. there was an error)<br />
Display Order amount message<br />
Set Inputs valid to False<br />
End If<br />
Call ValidateSalesTaxPercent function with Sales tax percent, returning Sales tax percent message<br />
If Sales tax percent message is not empty (i.e. there was an error)<br />
Display Sales tax percent message<br />
Set Inputs valid to False
End If<br />
If Inputs valid is True<br />
Get Order amount<br />
Get Sales tax percent<br />
Calculate Tax = Order amount * Sales tax percent<br />
Calculate Order total = Order amount + Tax<br />
Display Tax<br />
Display Order amount<br />
End If<br />
Stop button-click event handler<br />
Start ValidateOrderAmount function (Order amount)<br />
If Order amount is not numeric<br />
Set Order amount message to "Please enter a numeric order amount."<br />
Else If Order amount is less than or equal to zero<br />
Set Order amount message to "Please enter an order amount greater than zero."<br />
Else<br />
Set Order amount message to the empty string (no error)<br />
End If<br />
Return Order amount message<br />
Stop ValidateOrderAmount<br />
Start ValidateSalesTaxPercent (Sales tax percent)<br />
If Sales tax percent is not numeric<br />
Set Sales tax percent message to "Please enter a numeric sales tax percent."<br />
Else If Sales tax percent is less than zero or greater than 0.14<br />
Set Sales tax percent message to "Please enter a sales tax percent between 0.00 and 0.14."<br />
Else<br />
Set Sales tax percent message to the empty string(no error)<br />
End If<br />
Return Sales tax percent message<br />
Stop ValidateSalesTaxPercent<br />
Deliverables<br />
<br />
<br />
<br />
Submit a Word document named Lab5YourFirstLastName.docx (where YourFirstLastName = your first and<br />
last name; e.g., Lab5JohnSmith.docx) containing the following:<br />
Screenshot of form showing the application running, with non-numeric entries for Order amount and Sales tax<br />
percent, and appropriate error messages displayed.<br />
Screenshot of form showing the application running, with out-of-range entries for Order amount and Sales tax<br />
percent, and appropriate error messages displayed.
Screenshot of form showing the application running, with valid entries for Order amount and Sales tax percent,<br />
and correct Tax and Order total results displayed.<br />
Copy of code for button-click event, ValidateOrderAmount function, and ValidateSalesTaxPercent function.<br />
Category Points % Description<br />
Create and rename form 5 10%<br />
Add controls to form 5 10%<br />
Set properties for controls 5 10%<br />
Code button-click event 5 10%<br />
Windows form was created and renamed SalesTax.vb. Form text<br />
property was set toLab 5 Your Name (where Your Name = your<br />
full name).<br />
The following controls were added to the form: Identifying labels<br />
and text boxes for entry of order amount and sales tax percent;<br />
button to calculate total including tax; and list box for display of<br />
error messages and results.<br />
Name and text properties of all controls were set appropriately,<br />
with no typos or spelling errors.<br />
Button-click event code was entered that corresponds to the<br />
given pseudocode, with no syntax errors.<br />
Code<br />
function<br />
ValidateOrderAmount<br />
5 10%<br />
Function code was entered that corresponds to the given<br />
pseudocode, with no syntax errors.<br />
Code ValidateSalesTaxPercent<br />
5 10%<br />
function<br />
Function code was entered that corresponds to the given<br />
pseudocode, with no syntax errors.<br />
Application is shown running successfully with screen shots for<br />
each of the three test cases:<br />
Test-run application successfully 20 40%<br />
(1) non-numeric entries for order amount and sales tax percent,<br />
with appropriate error messages;<br />
(2) out-of-range entries for order amount and sales tax percent,<br />
with appropriate error messages; and<br />
(3) valid entries for order amount and sales tax percent, with<br />
correct tax and order total results.<br />
Total 50 100%<br />
Required Software<br />
Visual Studio 2012<br />
Access the software at.devry.edu/">https://lab.devry.edu.<br />
Steps: all<br />
iLAB STEPS<br />
Step 1: Launch Visual Studio and Create Project<br />
.equella.ecollege.com/file/dd98a67d-9ec9-4df4-8603-220cf23d1074/30/<strong>BIS</strong><strong>311</strong>_W5_<strong>iLab</strong>.html#top">Back to Top<br />
(a) Log into the Citrix <strong>iLab</strong> site as you did in the previous labs. Click the Microsoft Visual Studio 2012 icon to launch<br />
Visual Studio.<br />
(b) Pull down the File menu and select New Project . . .<br />
(c) In the New Project dialog, ensure that under Templates in the left column, Visual Basic is selected, and that in the<br />
center column, Windows Form Application is selected. In the Name field at the bottom of the dialog, enter SalesTax.<br />
Click OK.<br />
Step 2: Rename Form and Add Controls
.equella.ecollege.com/file/dd98a67d-9ec9-4df4-8603-220cf23d1074/30/<strong>BIS</strong><strong>311</strong>_W5_<strong>iLab</strong>.html#top">Back to Top<br />
(a) In the Solution Explorer pane on the right side of the screen, right-click on Form1.vb, select Rename, and change<br />
the name to SalesTax.vb. Press Enter after entering the new form name.<br />
(b) Change the Text property of the form to Lab 5 Your Name (where Your Name = your full name), as you have done<br />
in previous labs.<br />
(c) Drag the following controls from the ToolBox onto the form, arrange them in a logical fashion, and set their properties<br />
as indicated in the table below.