Microsoft Visual C#
Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
Question
Book Icon
Chapter 8, Problem 2E
Program Plan Intro

1. The following variables are used in the program.

  • num array of integer data type of size 10 is used to store the user-entered numbers.
  • max variable of integer data type is used to store the maximum value of the array.
  • min variable of integer data type is used to store the minimum value of the array.
  • total variable of integer data type is used to store the sum of all the elements of the array.
  • avg variable of double data types is used to store the average of all the elements in the array.

2. The following methods are used in the program:

  • fill() method to read numbers from console and assign to the array.
  • display() method to calculate the statistics and display the statistics of the array.

Program Description:

In this program, user-entered number are assigned to the array and its statistics are displayed to the user.

Blurred answer
Students have asked these similar questions
Create a program whose Main() method declares an array of 10 integers. Call a method to interactively fill the array with any number of values up to 10 or until a sentinel value is entered. If an entry is not an integer, re-prompt the user. Call a second method that accepts out parameters for the highest value in the array, lowest value in the array, sum of the values in the array, and arithmetic average. In the Main() method, display all the statistics.
Create a program whose Main() method declares an array of 10 integers. Call a method to interactively fill the array with any number of values up to 10 or until a sentinel value is entered. If an entry is not an integer, re-prompt the user. Call a second method that accepts out parameters for the highest value in the array, lowest value in the array, sum of the values in the array, and arithmetic average. In the Main() method, display all the statistics.Java Program
Define an array to be a 121 array if all elements are either 1 or 2 and it begins with one or more 1s followed by a one or more 2s and then ends with the same number of 1s that it begins with. Write a method named is121Array that returns 1 if its array argument is a 121 array, otherwise, it returns 0. There is one additional requirement. You should return 0 as soon as it is known that the array is not a 121 array; continuing to analyze the array would be a waste of CPU cycles. If you are programming in Java or C#, the function signature isint is121Array(int[ ] a) If you are programming in C or C++, the function signature isint is121Array(int a[ ], int len) where len is the number of elements in the array a. Examples a is then function returns reason {1, 2, 1} 1 because the same number of 1s are at the beginning and end of the array and there is at least one 2 in between them. {1, 1, 2, 2, 2, 1, 1} 1 because the same number of 1s are at the beginning and end of…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage