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

  Program that perform arithmetic operations on fractions

Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, where a and b are integers and b is not equal to 0. Your program must be menu driven, allowing the user to select the operation (+, -, *,..

  Design a class named productionworker that extends employee

The workday is divided into two shifts: day and night. The shift field will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Design the appropriate accessor and mutator ..

  Write a program that calculates net pay

Write a program that calculates Net Pay. It should do this by calling a function called CalNetPay that calculates and returns Net Pay when given the hours worked and the hourly pay rate. The main function should pass the hours worked and pay rate ..

  Write a only the client program

If the command is ADD then the details roll number and name will be added to a file. After adding the current request the file is sent back to the client. Write a only the client program.

  Counts the number of time a distinct input number occurs

Prepare a c/c++ program that counts the number of time a distinct input number occurs.

  Display a list of items and the location in the store

The program should display a list of items and the location in the store. The user must be able to enter the items and location in the store. You will use a class for the items. For this assignment you will implement creating the list, adding eleme..

  Implement c program for evaluating the polynomial

Implement C program for evaluating the polynomial f(x)= a 4 x 4 +a 3 x 3 +a 2 x 2+ a 1 x 1 +a 0 for a given value of x and its coefficient using Horner's method.

  Write a function num_digits(n)

C programing, not C++ write a function num_digits(n) that returns the number of digits in a nonnegative integer n.

  Requirements given in the problem statement

Develop the code that meets the requirements given in the problem statement. Use the concept of access specifiers while developing the code.

  Write a function that returns a string reversed

Write a function that returns a String reversed. That is, if the word is program, then the function will return margorp.

  Creating a part number

Write C++ program that asks a user to enter a part number to order. The rules for creating a part number are as follows:

  Difference between an object and a class

difference between an object and a class

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