Input ismealincld if ismealincld y thenoutput enter

This preview shows page 25 - 30 out of 37 pages.

12. Create the logic for a program that prompts a user for five numbers and stores them inan array. Pass the array to a method that reverses the order of the numbers. Display the reversed numbers in the main program.
Programming Logic and Design, 7e
Programming Logic and Design, 7e
13. Create the logic for a program that prompts a user for six numbers and stores them in an array. Pass the array to a method that calculates the arithmetic average of the numbers and returns the value to the calling program. Display each number and how far it is from the arithmetic average. Continue to prompt the user for additional sets ofsix numbers until the user wants to quit.
Programming Logic and Design, 7eSolutions 9-Pseudocode:startDeclarationsnum xnum averagestring doContinuenum LENGTH = 6num numbers[LENGTH]doContinue = “Y”while doContinue = “Y”x = 0while x < LENGTHoutput “Enter a number”input numbers[x]x = x + 128
Programming Logic and Design, 7e

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture