Question

Using This Guideline The problem Initial Plan: Execution and Evaluation: Revised Plan: Execution and Evaluation Write...

Using This Guideline

The problem

Initial Plan:

Execution and Evaluation:

Revised Plan:
Execution and Evaluation

Write a pseudocode algorithm based off C# that performs the following:

a) Read in 5 separate numbers from the user.

b) Calculate the average of the five numbers.

c) Find the smallest (minimum) and largest (maximum) of the five entered numbers.

d) Write out the results found from steps b and c with a message describing what the results were.

The algorithm output is as shown below.

Sample Output:

Average of all numbers = 56

Maximum number: 68

Minimum number: 23

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Pseudocode:

1) Initialize an array with the integer values.

2) Using for loop get the user input to store it in an array.

3) Using average method get the average value of the array values.

4) Sort the array and get the minimum and maximum values respectively.

Output will be like:

file://c:/users/pranesh/document Enter 5 separate numbers Enter number 42 Enter number 54 Enter number 76 Enter number 87 Enter number 45 Minimum number is 42 Maximum number is 87 veage value is 60.8

Code will be like:

using System;
using System.Collections.Generic;
using System.Linq;


namespace ValidateUserNUmberConsole
{
class Program
{
static void Main(string[] args)
{
int[] arr = new int[5];
Console.WriteLine("Enter 5 separate numbers");
for(int i=0;i<5;i++)
{
Console.WriteLine("Enter number");
arr[i] = Convert.ToInt16(Console.ReadLine());
}

double avg = arr.Average();

Array.Sort(arr);

int min = arr[0];
int max = arr[4];

Console.WriteLine("Minimum number is " + min);
Console.WriteLine("Maximum number is " + max);
Console.WriteLine("Aveage value is " + avg);

Console.ReadLine();

}
}
}

Please rate it if the above solution helps you in any way or if you have any concerns comment it, I will help you through again.

Add a comment
Know the answer?
Add Answer to:
Using This Guideline The problem Initial Plan: Execution and Evaluation: Revised Plan: Execution and Evaluation Write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Example 3: Draw a flowchart that performs the following: Ask a user to enter a number....

    Example 3: Draw a flowchart that performs the following: Ask a user to enter a number. If the number is between 0 and 10, write the word blue. If the number is between 10 and 20, write the word red. if the number is between 20 and 30, write the word green. If it is any other number, write that it is not a correct color option. Example 4: Draw a flowchart to print all multiples of 5 between 1...

  • ​ Draw a flowchart

     Draw a flowchart that will perform the following.a) Read in 5 separate numbers.b) Calculate the average of the five numbers.c) Find the smallest (minimum) and largest (maximum) of the five entered numbers.d) Write out the results found from steps b and c with a message describing what they are

  • 5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters...

    5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number. Enter 7, 2, bob, 10, and 4 and match the output below. ​ 1 largest = None 2 smallest = None 3 while True: 4...

  • Write a C++ program that does the following: Asks the user to enter 3 integers, Obtains...

    Write a C++ program that does the following: Asks the user to enter 3 integers, Obtains the numbers from the user, Prints the largest number and then the smallest of the numbers, If the numbers are equal, prints the message: "These numbers are equal." Prints the sum, average, and product of the 3 numbers.

  • Write a menu based program implementing the following functions: (0) Write a function called displayMenu that...

    Write a menu based program implementing the following functions: (0) Write a function called displayMenu that does not take any parameters, but returns an integer representing your user's menu choice. Your program's main function should only comprise of the following: a do/while loop with the displayMenu function call inside the loop body switch/case, or if/else if/ ... for handling the calls of the functions based on the menu choice selected in displayMenu. the do/while loop should always continue as long...

  • In C++ 2. Write a program that allows the user to enter a series of positive...

    In C++ 2. Write a program that allows the user to enter a series of positive numbers between 1 and 100 and displays the smallest and largest of the numbers entered. The program should not store the numbers that were entered, only keep track of the smallest and largest ones. The program should continue accepting numbers until the value 0 is entered and then display the results. If a number out of range is entered, tell the user it is...

  • JavaScript - I need help formulating executable code for the following problem. 7.15 The process of...

    JavaScript - I need help formulating executable code for the following problem. 7.15 The process of finding the largest value (i.e., the maximum of a group of values) is used frequently in computer applications. For example, a script that determines the winner of a sales contest would input the number of units sold by each sales person. The salesperson who sells the most units wins the contest. Write a pseudocode ode algorithm and then a script that inputs a series...

  • Write the code in C with all the right output please. Problem: In this assignment you...

    Write the code in C with all the right output please. Problem: In this assignment you will analyze a data set of 10,000 randomly generated integers. From this data set you will display a count of the prime numbers that are greater than the average (double) of the entire data set. The user will input only a single integer value to serve as the seed for the random number generator. The use of a common seed will result in output...

  • Python Script format please! 1. Write a script that takes in three integer numbers from the...

    Python Script format please! 1. Write a script that takes in three integer numbers from the user, calculates, and displays the sum, average, product, smallest, and largest of the numbers input. Important things to note: a. You cannot use the min() or max() functions, you must provide the logic yourself b. The calculated average must be displayed as an integer value (ex. If the sum of the three values is 7, the average displayed should be 2, not 2.3333). Example:...

  • You are required to write an interactive program that prompts the user for seven (7) real...

    You are required to write an interactive program that prompts the user for seven (7) real numbers and performs the following tasks: Reads and stores the numbers into one-dimensional array called A. Calculates the sum of the numbers. Find the average of the numbers. Finds the smallest value of the numbers. Prints all the results with proper headings. Program requirements: -     The program must contain at least five functions using necessary parameters. These functions should read the data, perform the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT