Accept positive and negative numbers in its input sequence

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

Requirements:

  • The program must accept positive and negative numbers in its input sequence, and ?nd the largest and smallest

of the numbers entered whether they are all positive, all negative, or a combination of both positive and negative.

  • Entering 0 must terminate the input sequence and cause the result to be displayed.
  • If the ?rst number entered is zero, then the input sequence is empty and a message stating this must be

displayed (as shown in the sample run below) instead of showing the largest and smallest numbers.

  • Name the source ?le for your program program2.c
  • The prompts and output displayed by the program must be formated as shown in the sample run below (e.g.

blank lines, spacing, case of text).

  • A sample run of the program with only positive numbers:

Entering 0 will terminate the sequence of input values.

Enter a number: 9

Enter a number: 5.2

Enter a number: 44

Enter a number: 0

Your largest number was 44.000. Your smallest number was 5.200.

  • A sample run of the program with only negative numbers:

Entering 0 will terminate the sequence of input values.

Enter a number: -4

Enter a number: -38

Enter a number: -5.6

Enter a number: 0

Your largest number was -4.000. Your smallest number was -38.000.

  • A sample run of the program with both positive and negative numbers:

Entering 0 will terminate the sequence of input values.

Enter a number: 6

Enter a number: 78

Enter a number: -3

Enter a number: 0

Your largest number was 78.000. Your smallest number was -3.000.

  • A sample run of the program with an empty input sequence:

Entering 0 will terminate the sequence of input values.

Enter a number: 0

Your input sequence was empty.Hints:

  • How will you keep track of whether or not any numbers have been entered? Think about what variables you

need.

  • What needs to be done di?erently when the ?rst number is read compared to when later numbers are read?
  • Are the above two items related?

 

 

Reference no: EM13168077

Questions Cloud

Compute the volume of the bottle could deliver to a climber : calculate the volume of O2 the bottle could deliver to a climber at an altitude where the temp is -38 C and the atmospheric pressure is 0.40 atm.
A "mynum" class that will read "randfile.txt" file : A "MyNum" class that will read "randFile.txt" file and obtain the 20,000 integer numbers
Input a temperature as a floating point : Your program should input a temperature as a floating point number with an appended unit letter. It should then print the temperature in all four of the units above
Explain the total pressure in the flask : determine the total pressure in the flask AND the height difference between the two arms of the manometer.
Accept positive and negative numbers in its input sequence : the program must accept positive and negative numbers in its input sequence, and ?nd the largest and smallestof the numbers entered whether they are all positive, all negative, or a combination of both positive and negative.
The analog to digital converter : The Analog to Digital converter has V(t) as its input, and it outputs a binary word B(t) with a fixed length of k bits, which is its best approximation to V(t). Suppose that V(t) can vary continuously between zero and 5 volts
Explain what is the total pressure above the solution : What is the vapor pressure of each of the solution components in the mixture? What is the total pressure above the solution?
Reflect upon the it strategies : Reflect upon the IT strategies that are used to encourage economic development. Select two strategies and discuss how economic factors affect the strategies that a government may use to facilitate economic development.
What provided the added kinetic energy : What provided the added kinetic energy?   None of these is correct. the momentum of the platform the man moving the weights further away from his body the man pulling the weights closer to his body

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