write this in pseudocode  #4 – In pseudocode, write a for-loop that decreases from 100 to 2 by 2s. Inside the loop, print the value of the loop variable unless the value is from 60 to 80 (inclusive). Use only 1  if-statement. Do NOT write Python code!   Write your answer below:    #5 – Review the decision structure given below.   If myAnswer > 20 Then     myAnswer = myAnswer - 25 Else If myAnswer <= 5 Then     If myAnswer < 0 Then         myAnswer = 10     If myAnswer < 3 Then         myAnswer += 10     Else         myAnswer += 1 Else     myAnswer = 9  If myAnswer < 10 Then myAnswer += 1 Display myAnswer What are the results displayed when the decision structure above executes for each given value below: If       myAnswer = 6        then myAnswer =          myAnswer = 15      then myAnswer =            myAnswer = 30      then myAnswer =               myAnswer = 2     then myAnswer =              myAnswer = -1    then myAnswer =        #6 – 2-dimensional arrays can be thought of as containing rows and columns. What are the subscript values for a 2-dimensional array?  Enter them in the array below (first set given)                                                                                 [0,0] [   ] [   ] [   ] [   ] [   ] [   ] [   ] [   ]  [   ] [   ] [   ] [   ] [   ] [   ]

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 28PE
icon
Related questions
Question

write this in pseudocode 

#4 – In pseudocode, write a for-loop that decreases from 100 to 2 by 2s. Inside the loop, print the value of the loop variable unless the value is from 60 to 80 (inclusive). Use only 1 
if-statement. Do NOT write Python code!
 
Write your answer below:
  



#5 – Review the decision structure given below.
 
If myAnswer > 20 Then
    myAnswer = myAnswer - 25
Else If myAnswer <= 5 Then
    If myAnswer < 0 Then
        myAnswer = 10
    If myAnswer < 3 Then
        myAnswer += 10
    Else
        myAnswer += 1
Else
    myAnswer = 9 
If myAnswer < 10 Then
myAnswer += 1

Display myAnswer

What are the results displayed when the decision structure above executes for each given value below:
If       myAnswer = 6        then myAnswer =
         myAnswer = 15      then myAnswer =  
         myAnswer = 30      then myAnswer =     
         myAnswer = 2     then myAnswer =    
         myAnswer = -1    then myAnswer =   
 
 

#6 – 2-dimensional arrays can be thought of as containing rows and columns. What are the subscript values for a 2-dimensional array? 
Enter them in the array below (first set given)                                                                                

[0,0] [   ] [   ]
[   ] [   ] [   ]
[   ] [   ] [   ] 
[   ] [   ] [   ]
[   ] [   ] [   ]

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

In Pseudocode 

#7 – List 4 main data types we used in this course and describe the data that is stored in each one. List examples of variable names that make sense for each data type.



 

#8 – Debug this input validation function and fix it. There is a lot wrong with it! 

 

Function Integer getNumberGreaterThanX(msg, x)

myInteger = getInteger(msg)

While myInteger < x 

Display "The number must be < “, myInteger , “. Try again."

Input x

End While

 

End Function

 

Write the corrected function below:

 

 

 

#9 – Write a validation function based on the provided variables and call statement below. The validation function should return an Integer value greater than zero or print an error message until an acceptable value is entered.

 

Declare Integer positiveValue = 0

Declare String message = "Enter the year you were born (no negative numbers!)"

 

positiveValue = getNumberGreaterThanZero(message)

         

 Write the function definition below:

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Mathematical functions
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT