1 get input n 2 set a variable num = 1 3 if num <= _(1)_, goto step 4, otherwise go to step 11 4 set a variable factor = 1 5 if factor <= num goto step 6, otherwise goto _(2)- 6 if factor*factor == num, print "num is a perfect square" 7 if factor*factor*factor == num, print “num is a perfect cube" 8 if (3)_ and (4)_, goto step 10 9 increment factor: factor = factor+1, goto step 5 10 increment num: num = num+1, goto _(5)_ 11 terminate program

Principles of Information Systems (MindTap Course List)
12th Edition
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter3: Hardware: Input, Processing, Output, And Storage Devices
Section: Chapter Questions
Problem 11SAT
icon
Related questions
Question
100%

Fill in the blanks of the pseudocode that will accept a value for a positive integer N. Then, be able to determine which values from 1 to N are perfect squares and which are perfect cubes.

1 get input n
2 set a variable num = 1
3 if num <= _(1)_, goto step 4, otherwise go to step 11
4 set a variable factor = 1
5 if factor <= num goto step 6, otherwise goto _(2)_
6 if factor*factor == num, print “num is a perfect square"
7 if factor*factor*factor == num, print "num is a perfect cube"
8 if -(3)_ and _(4)_, goto step 10
9 increment factor: factor = factor+1, goto step 5
10 increment num: num = num+1, goto _(5)_
11 terminate program
Transcribed Image Text:1 get input n 2 set a variable num = 1 3 if num <= _(1)_, goto step 4, otherwise go to step 11 4 set a variable factor = 1 5 if factor <= num goto step 6, otherwise goto _(2)_ 6 if factor*factor == num, print “num is a perfect square" 7 if factor*factor*factor == num, print "num is a perfect cube" 8 if -(3)_ and _(4)_, goto step 10 9 increment factor: factor = factor+1, goto step 5 10 increment num: num = num+1, goto _(5)_ 11 terminate program
N = 100
1
is a perfect square
1 is a perfect
4 is a perfect square
8
cube
is a perfect cube
is a perfect square
9
16 is a perfect square
25 is a perfect square
27 is a perfect cube
36
is a perfect square
49 is a perfect square
64
is a perfect cube
64 is a perfect square
81
is a perfect square
100
is a perfect square
Transcribed Image Text:N = 100 1 is a perfect square 1 is a perfect 4 is a perfect square 8 cube is a perfect cube is a perfect square 9 16 is a perfect square 25 is a perfect square 27 is a perfect cube 36 is a perfect square 49 is a perfect square 64 is a perfect cube 64 is a perfect square 81 is a perfect square 100 is a perfect square
Expert Solution
steps

Step by step

Solved in 5 steps

Blurred answer
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
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning