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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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