Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question
Please write code that will run in VBA excel please show code in VBA attached is the code to fix and instructions thanks
1. There is code already created for you in the attachment. This code asks the user for their age. It
should then put up a message, depending on the age. The exact message does not matter here,
do not worry about that, just focus on the age ranges.
Under 18
You have so much ahead of you.
Between 18(inclusive) and 21(exclusive)
Between 21(inclusive) and 63(exclusive)
You can vote!
You can drink and vote....
63 or over
You can drink, vote, and get social security
The program then asks the user if they want to enter another age. If they click yes, the program
starts all over, otherwise it ends.
There are several errors that are keeping this code from working properly. Test the code using different
inputs. Debug the code so that it works as intended. You will not need to add any chunks of code to get
it to work, just correct what is there
expand button
Transcribed Image Text:1. There is code already created for you in the attachment. This code asks the user for their age. It should then put up a message, depending on the age. The exact message does not matter here, do not worry about that, just focus on the age ranges. Under 18 You have so much ahead of you. Between 18(inclusive) and 21(exclusive) Between 21(inclusive) and 63(exclusive) You can vote! You can drink and vote.... 63 or over You can drink, vote, and get social security The program then asks the user if they want to enter another age. If they click yes, the program starts all over, otherwise it ends. There are several errors that are keeping this code from working properly. Test the code using different inputs. Debug the code so that it works as intended. You will not need to add any chunks of code to get it to work, just correct what is there
(General)
Sub AgeLaws()
Dim intAge As Integer
Dim intAgain As Integer
intAge
InputBox ("How old are you?"", "Enter Age")
If intAge >= 18 And intAge < 21 Then
strAnswer = "You can vote!"
ElseIf intAge >= 21 < 63 Then
strAnswer = "You can vote and drink.
Please, not at the same time."
ElseIf Age >= 63 Then
strAnswer = "You can vote, drink, and get you get Social Security!"
Else
strAnswer = "You have so ma
things ahead of you!"
End If
MsgBox strAnwser
intAgain
MsgBox ("Do you want to check another age?", vbYesNo)
%3D
If intAgain = 0 Then
AgeLaws
End If
End Sub
expand button
Transcribed Image Text:(General) Sub AgeLaws() Dim intAge As Integer Dim intAgain As Integer intAge InputBox ("How old are you?"", "Enter Age") If intAge >= 18 And intAge < 21 Then strAnswer = "You can vote!" ElseIf intAge >= 21 < 63 Then strAnswer = "You can vote and drink. Please, not at the same time." ElseIf Age >= 63 Then strAnswer = "You can vote, drink, and get you get Social Security!" Else strAnswer = "You have so ma things ahead of you!" End If MsgBox strAnwser intAgain MsgBox ("Do you want to check another age?", vbYesNo) %3D If intAgain = 0 Then AgeLaws End If End Sub
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY