Modify the program to enter any amount of numbers

Assignment Help Programming Languages
Reference no: EM13784225

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

Reference no: EM13784225

Questions Cloud

Customer survey : How much will you be willing to pay for the new product/service?
How will you find cases systematically and record informatio : How will you find cases systematically and record information
Man-made or natural disaster or crisis : Select one (1) current man-made or natural disaster or crisis with international effects or implications. Analyze at least three (3) reasons why the disaster / crisis in question may cause continuing international challenges
Change management plan presentation : You work for an organization that has a very diverse workforce.  Several of your employees have been with the company for many years and are very set in their ways and routines.
Modify the program to enter any amount of numbers : 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.
Individual learning project instructions : Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 ..
Learned about third world countries : What do you think is the likely future of the planet, given what you have learned about Third World countries? Bring in some of the relevant issues such as:
General concept of co-morbidity : Discuss the general concept of co-morbidity. Explain the unique way the two symptom sets interact using the co-morbid pair you chose.
Aspects of accomplishing tasks : Consider how groups of people can have a greater impact on social change than individuals. What aspects of accomplishing tasks are made easier by working in groups?

Reviews

Write a Review

Programming Languages Questions & Answers

  Compute average of values contained in integer

Compute the average (as a double) of values contained in integer variables num1, num2, num3 and allot that average to double variable avg.

  Write program to calculate cost of flowers sold at stand

Write down the program in class FlowerCounter which calculates the cost of flowers sold at flower stand. Five types of flowers-petunia, pansy, rose, violet, and camation- are stocked and cost.

  What is java adapter class

What is Java adapter class.

  Design a math sorting game

Using Visual Studio 2010, design a math sorting game. A random number between 1 and 99 will be generated and displayed to the user. User will quickly have to divide that number by 3, and come up with remainder.

  Payroll program for a company

Write complete PAYROLL program for a company in which each employee falls into one of 3 categories - Administrative, Factory Employee or Salesperson.

  Write program that asks user to enter five test scores

Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score.

  Matrix multiplication code with mpi

Matrix multiplication code with MPI. At the beginning of each of the programs, write names of group members in the comment line.

  Write pseudocode

Write pseudocode that represents the abstract functions of the enqueue and dequeue operations. Define and explain any supplementary information needed by your pseudocode.

  Html5 assignment i need an assignment for html5 containing

i need an assignment for html5 containing 2 parts1 3 pages html5 website2 report more important than the website

  Find the position s of a body in linear motion

How many miles will the car go during the period of acceleration from zero to 60 mph? Use the given program to answer this question - Prepare code to declare variables for s0, v0, a, and t, and then write the code to compute s on the basis of these ..

  Write a program to display the duplicate values in an array

Write a program to display the duplicate values in an array.

  Write a program which generates 100 three-digit random

an armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd