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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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