You are on page 1of 44

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .

2 r d ctio ro ram in ith al asics

Search

Explore

Publish

academics...

business,

presentations,

books,

Search

Download

like http://www.scribd.com/doc/60957060/4/EXERCISES-3-2 AVrDVdPK


Link Embed Zoom of 211 Readcast
Like 0 Tweet
20

Comment

Share

Related

Next

EXERCISES 3.2 for Itroduction to programming with visual basics


Student Solutions Manual (Page 1 of 211) STUDENT SOLUTIONS MANUAL to accompany An Introduction to Programming Using Visual Basic 2010, 8th Edition by David I. Schneider Stude... (More)

Download or Print
Add To Collection
15 p. 53 p. 60 p.

Final Exam
Jacqueline J Masloff 873 Reads

Visual Basic
1990 rahul 445 Reads

Chuong Trinh VBA Cad_ i hc xy dungj


Nguyen Tu 465 Reads

9.0K
READS

6
READCASTS

5
EMBED VIEWS

Published by

Nani Babu Kadiyapu

Leave a Comment
Search

Characters: 400

Submit

Sections
EXERCISES 2.2 EXERCISES 2.3 EXERCISES 3.1 EXERCISES 3.2 EXERCISES 4.1 EXERCISES 4.2 EXERCISES 4.3 EXERCISES 4.4 EXERCISES 5.1 EXERCISES 5.2 EXERCISES 5.3 EXERCISES 6.1 EXERCISES 6.2 EXERCISES 6.3 EXERCISES 7.1 EXERCISES 7.2 EXERCISES 7.3

Info and Rating


Category: Uncategorized. Rating: Upload Date: 07/26/2011 Copyright: Attribution Non-commercial Tags: This document has no tags. Free ebook download as PDF File (.pdf), text file (.txt) or read book online for free. Flag document for inapproriate content

About
About Scribd Blog Join our team! Contact Us

Advertise with us
Get started AdChoices

Support
Help FAQ Press

Partners
Publishers Developers / API

Legal
Terms Privacy Copyright

Copyright 2012 Scribd Inc. Language: English

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

Student Solutions Manual (Page 18 of 211)

CHAPTER 3 EXERCISES 3.1

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

1. 12 13. Valid
59. 23.

3. .125

5. 8

7. 2

9. 1

11. Not valid 19. 16 21. 9

Student Solutions Manual (Page 19 of 211)

15. Not valid

17. 10

25.

Private Sub btnCompute_Click(...) Handles btnCompute.Click Private revenue, costs, profit As Double Dim Sub btnCompute_Click(...) Handles btnCompute.Click lstOutput.Items.Add((7 * 8) + 5) revenue = 98456 End Sub= 45000 costs profit = revenue - costs Private Sub btnCompute_Click(...) Handles btnCompute.Click lstOutput.Items.Add(profit) lstOutput.Items.Add(0.055 * 20) End Sub End Sub

Private Sub btnCompute_Click(...) Handles btnCompute.Click Student Solutions Manual (Page 20 of 211) Private price, discountPercent, markdown As Double Dim Sub btnCompute_Click(...) Handles btnCompute.Click lstOutput.Items.Add(17 * (3 + 162)) price = 19.95 End Sub discountPercent = 30 69. Private Sub btnCompute_Click(...)100) * price markdown = (discountPercent / Handles btnCompute.Click 29. Dim = price - elapsedTime, averageSpeed As Double price distance,markdown x y distance = 233 lstOutput.Items.Add(Math.Round(price, 2)) Private Sub btnEvaluate_Click(...) Handles btnEvaluate.Click elapsedTime = 7 - 2 End Sub Dim x, y As Double = distance / elapsedTime 0 0 averageSpeed x =Private Sub btnCompute_Click(...) Handles btnCompute.Click 2 lstOutput.Items.Add(averageSpeed) 2 0 63. y =End x balance As Double 3 Dim * Sub 2 6 Student Solutions Manual11 6 21 of 211) (Page x = ybalance = 100 +5 balance += 0.05 * lstResults.Items.Clear()balance 11 6 balance += 0.05 * + 4) lstResults.Items.Add(x balance 11 6 y = ybalance += 0.05 * balance + 1 3.2 11 7 EXERCISES lstOutput.Items.Add(Math.Round(balance, 2)) End Sub End Sub 1. Visual Basic 33. 1 3. Ernie 35. 5. flute 7. 9. Your age is 21. 31. 6 1 37. 123 2 65. Private Sub btnCompute_Click(...) Handles btnCompute.Click 8 64 15 11. A ROSE IS A ROSE IS A ROSE 13. 5.5 15. goodbye 17. WALLAWALLA Dim balance As 9 Double balance = 100 balance = balance 12 25. True 19. The third line should *read c^=10) b 21. (1.05 a + 23. 8 (0 through 39. ABC Sub btnCompute_Click(...) Handles btnCompute.Click 7) 71. 2 MUNICIPALITY Private lstOutput.Items.Add(Math.Round(balance, 2)) Dim Student Solutions Manual (Page 22 of 211) End Sub 4 city waterPerPersonPerDay, people, days, waterUsed As Double 41. ThewaterPerPersonPerDay = 1600 first assignment statement should not contain a comma. The second assignment 55 mph 6 people 67. statement= 315000000contain a dollar sign. Private should not STU Sub btnCompute_Click(...) Handles btnCompute.Click days = 365 Dim Sub btnCompute_Click(...) Handles 39. Private acres, yieldPerAcre, corn As Double btnCompute.Click waterUsed = waterPerPersonPerDay * people * days acres = 30 As Double 27. 9W variable phoneNumbername. be declared as type String, not12 should 45. Dim quantity As Integer = Double. 43. TheDimnot a valid 18 is distance lstOutput.Items.Add(waterUsed) yieldPerAcre = variable distance = CDbl(txtNumSec.Text) / 5 End Sub yieldPerAcre * acres corn = = 47. Enddistance49.Math.Round(distance, 2) as a variable name.55. 0 6 51. 3 57. 6 29. 10 lstOutput.Items.Add(corn) beof the storm 53. &distance & " miles." is a keyword and cannot 3.128 txtOutput.Text = "The distance used is " End Sub End Sub 31. The IndexOf method cannot be applied to a number, only a string.

61. 27.

Student Solutions Manual (Page 23 of 211)


33. 45. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Dim firstName, middleName, lastName As String Dim Sub btnCompute_Click(...) Handles btnCompute.Click Private yearOfBirth As Integer firstName = "Thomas" Dim amount, percentage, tip As Double middleName = "Alva"

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

amount = CDbl(txtAmount.Text) lastName percentage=="Edison" CDbl(txtPercentage.Text) yearOfBirth =*1847 tip = amount (percentage / 100) txtOutput.Text = firstName & " " & middleName & " " & lastName & txtTip.Text = CStr(Math.Round(tip, 2)) ", " & yearOfBirth End Sub End Sub 35. 41. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Private publisher As String Dim Sub btnCompute_Click(...) Handles btnCompute.Click Dim cycling, running, swimming, publisher = "Prentice Hall, Inc." pounds As Double cycling = CDbl(txtCycle.Text) txtOutput.Text = "(c) " & publisher running End Sub = CDbl(txtRun.Text) swimming = CDbl(txtSwim.Text) pounds =String * cycling in 475 Declarations section of the program Dim str As (200 'Place + the * running + 275 * swimming) / 3500 pounds = Math.Round(pounds, 1) txtWtLoss.Text = pounds & " pounds were lost." End Sub Private Sub btnCompute_Click(...) Handles btnCompute.Click Dim revenue, expenses, income As Double revenue = CDbl(txtRevenue.Text) 'in Declarations section Dim number= CDbl(txtExpenses.Text) expenses As Integer = 100 'Note: the = revenue - expenses Text property of txtOutput was set to 100 at design time income txtNetIncome.Text = CStr(income) Private Sub btnPressMe_Click(...) Handles btnPressMe.Click End Sub number = number - 1 'decrease number by 1 txtOutput.Text = CStr(number) End Sub

37.

43. 47.

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M

E E C E 3 fo Itro u ntop g m gw visu b X R IS S .2 r d ctio ro ram in ith al asics

h ://w w d m o 0 5 0 0 /E E C E -3 # ag 2 [9 9 0 25 1 1P ] ttp w .scrib .co /d c/6 9 7 6 /4 X R IS S -2 p e= 1 /2 /2 1 :1 :3 M