2023 Design the logic for a program that allows a user to enter 12 numbers then | Assignment Collections
Computer Science 2023 Design The Logic For A Program That Allows A User To Enter 12 Numbers
2023 Design the logic for a program that allows a user to enter 12 numbers then | Assignment Collections
Design the logic for a program that allows a user to enter 12 numbers, then displays each number and its difference from the numeric average of the numbers entered, using provided pseudocode.
start
Declarations
num index
num sum
num avg
num SIZE = 12
num numbers[SIZE] = 0,0,0,0,0,0,0,0,0,0
getReady()
while index < SIZE
getNumbers()
endwhile
finishUp()
stop
getReady()
index = 0
sum = 0
return
getNumbers()
output “Enter a number for position ”, index
input numbers[index]
sum = sum + numbers[index]
index = index + 1
return
finishUp()
avg = sum/SIZE
index = 0
while index < SIZE
output numbers[index], avg – numbers[index]
index = index + 1
endwhile
return
Modify the program in Exercise 2a so that the user can enter any amount of numbers up to 12 until a sentinel value is entered.
start
Declarations
num index
num sum
num avg
num actualSize
num SIZE = 12
num numbers[SIZE] = 0
string CONTINUE = “Y”
string moreNumbers = CONTINUE
getReady()
while index 0 then
avg = sum/actualSize
index = 0
while index < actualSize
output numbers[index], avg – numbers[index]
index = index + 1
endwhile
endif
return
We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.