Write c code to repeatedly ask the user for a number

Assignment Help C/C++ Programming
Reference no: EM132271680

Question: Write C code to repeatedly ask the user for a number, then once the user enters 0, the code displays the min, max and average of all values entered.

To get proper credit, name the variables as listed below and follow the directions carefully. Do not use any break or similar type of statements.

To implement the above code, you will need to count the entries - name the counter variable num_count.

You will also need to use a variable, name it min_in so each time the user gives input, and the input is not 0, then compare min_in with the input, if the min_in is > input, then assign min_in to the input.

Similarly name another variable max_in, and compare it to the input, but assign max_in to the input only if max_in is < input.

To calculate the average, accumulate each input into a variable, total. Then after the loop the average is the total divided by the number of entries.

Once the loop is over, display the calculated values (min, max and the average) with a proper wording in three lines. The input is not restricted to integer value so declare the variables above with a proper type. Show the output using two decimal places, and align the three output values as in this sample output:

The minimum entry was: 2.30

The maximum entry was: 62.51

The average of all entries was: 52.81

Zip your entire project folder before uploading.

Reference no: EM132271680

Questions Cloud

Research the concept of compilation : 1. Research the concept of compilation with regards to code? 2. Is there a difference in how scripts are compiled vs how programs are compiled?
Ethical role of manager in long-term care facility : Ethical role of manager in long-term care facility when faced with a family decision to withhold nutrition and fluids to a terminal and semi-comatose patient.
How to understand the visualization as viewer : This week we will concentrate on creating visualizations (write) and consuming visualizations (read) (Kirk, 2016). We must first learn how to understand.
Which leader can communicate shared vision : What are some ways in which a leader can communicate a shared vision?
Write c code to repeatedly ask the user for a number : Write C code to repeatedly ask the user for a number, then once the user enters 0, the code displays the min, max and average of all values entered.
Define the irac method of legal reasoning : Define the IRAC method of legal reasoning. State what each letter in the IRAC acronym stands for, and provide a definition for each.
Describe the it governance system : Describe the IT governance system that was in place at the University of the Southeast using both decision rights and structure as the basis of goverance.
What is the terminology given to that transmission : If a WhatsApp message is transmitting at 16 bits per second, what is the terminology given to that transmission?
What are the objectives of the marketing strategy : What are the objectives of the marketing strategy? What marketing concepts are at issue in the current strategy?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Compiling in dev c++ program

I will post my code. Just so you know that before implementing the template the program worked fine but I believe the issue is in the declaration of the friend functions somehow.

  Would this code sequence compile? explain.

Using pseudocode or C++, write the statements to enter an integer number, compute the number raised to power 5 and output the result

  A company that market is publishing both book and audio cass

A company that market is publishing both book and audiocassette versions

  Find the concentration of a base used in titration

How would I find the concentration of a base used in titration given the following data: Volume of acid in Erlenmeyer flask = 25.00 mL (HCl) Molar concentration of acid in Erlenmeyer flask = 0.2127 M (HCl)

  Implement method to advance any given date by one day

Write C++ implementation of this method. Create and specify any other methods that you require. Include comments which will be helpful to someone who will maintain implementation in the future.

  C is a general-purpose programming language designed as an

c is a general-purpose programming language designed as an improvement to the c programming language. in short the

  Find out the data that you will have in the program

Find out the data that you will have in the program. Find out what are the data structures you need to use to store those data. Find out the actions that your program needs for the game. All the actions will be functions.

  Two types of constructors

Explain what constructors do and when they are executed. Explain the two types of constructors. Provide an example class that includes both types of constructor functions and demonstrate how an object would be instantiated using both types of constru..

  Create a graphical calculator with buttons

Create a graphical calculator with buttons that can add, subtract, multiply, divide, +/-, Sin, Cos, Tan, clear and Modulus and write a method for each of these calculations that will accept the needed incoming numbers and return the calculated value.

  Write program which inputs sequence of digits from data file

Write a program which inputs sequences of digits (one sequence per line with no spaces between the digits) from the data file DigitSeq.txt.

  Determine a mixed strategy for terry

If he studies biology and there is a quiz in it, he gains ten points but there is no gain if there is no quiz. Determine a mixed strategy for Terry, and the expected payoff.

  Test debug and execute the c program

State which of the following are true and which are false. If a statement is false, explain why.

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