Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the average amount of steps that it takes this program to run if the input n is between or equal to 0 and

image text in transcribed

What is the average amount of steps that it takes this program to run if the input n is between or equal to 0 and 100 . Beginning of the program the user inputs n.

if n

else if n >= 20 or n

a = n - 1

b = 2

while a >=0

a = a- 1

b =2*b

end the while

Print out ("2^n = b")

Else If n > 60

a = n

b = 0

while a > 0

b= b+a

a = a-1

end the while loop

Print "The sum is b"

end program

2 WP M 220M 220". ades WHAT IS THE AVERAGE NUMBER OF STEPS THAT THE FOR PROGRAMME TAKE TO COMPLETE CIE IF You Know THAT IF YOU KNOW THAT OEM S100 O BEGO PROGRAMME A: M POT M ob:=0 IF M0 DO ELSE IF 220 & ns 60, THE bi= bta a: M-1 - a:=a-1 b:=2 . ES WHILE WHCLE a 20 DO Pror Che Sum is b" A: a-1 bi=2.b . Es IF EVS WHILE END PROGRAMME PROT ("2"=6") ELSE IF n> 60, THE (CONSUED TO THE RIGHT)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions