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
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:
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.
Using This Guideline The problem Initial Plan: Execution and Evaluation: Revised Plan: Execution and Evaluation Write...
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 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 '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 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 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 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 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 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 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 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...