Write a VB program to ask user to assign a value to “i” to find the answer for the following three cases. 1. Case 1. Assume i = 1 and HowMuch = 0 IF i < 5 THEN HowMuch = HowMuch + 1 ELSEIF i = 5 THEN HowMuch = HowMuch - 5 ELSE HowMuch = HowMuch + 3 END IF DISPLAY HowMuch 2. Case 2. Assume i = 5 and HowMuch = 0 IF i < 5 THEN HowMuch = HowMuch + 1 ELSEIF i = 5 THEN HowMuch = HowMuch - 5 ELSE HowMuch = HowMuch + 3 END IF DISPLAY HowMuch 3. Case 3. Assume i = 6 and HowMuch = 0 IF i < 5 THEN HowMuch = HowMuch + 1 ELSEIF i = 5 THEN HowMuch = HowMuch - 5 ELSE HowMuch = HowMuch + 3 END IF DISPLAY HowMuch

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 27PE
icon
Related questions
icon
Concept explainers
Question

Write a VB program to ask user to assign a value to “i” to find the answer for the following three cases.


1. Case 1. Assume i = 1 and HowMuch = 0
IF i < 5 THEN
HowMuch = HowMuch + 1
ELSEIF i = 5 THEN
HowMuch = HowMuch - 5
ELSE
HowMuch = HowMuch + 3
END IF
DISPLAY HowMuch
2. Case 2. Assume i = 5 and HowMuch = 0
IF i < 5 THEN
HowMuch = HowMuch + 1
ELSEIF i = 5 THEN
HowMuch = HowMuch - 5
ELSE
HowMuch = HowMuch + 3
END IF
DISPLAY HowMuch
3. Case 3. Assume i = 6 and HowMuch = 0
IF i < 5 THEN
HowMuch = HowMuch + 1
ELSEIF i = 5 THEN
HowMuch = HowMuch - 5
ELSE
HowMuch = HowMuch + 3
END IF
DISPLAY HowMuch

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT