Determine the minimum and maximum parameters

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

int GetValidatedInt(const char* strMessage, int nMinimumRange = 0, int nMaximumRange = 0);

This function should first display the provided message to the screen then use cin to get an int from the user. Error check and validate to ensure a legal integer was entered. If not, clear the cin buffer using clear() and ignore() and try again (Note: the buffer still needs to be cleared even if this step was successful).

If a legal integer was entered, check its value to see if it is within the provided minimum and maximum range (inclusive). If the user input was within the range, return the integer. If not, get input again. The range check should be ignored if BOTH the minimum and maximum parameters are 0, so any valid integer is acceptable.

You should be using a loop so that the method does not return until a valid and within range (if the range is not 0) integer was totally provided.

Reference no: EM133201531

Questions Cloud

What decisions-strategies led to its failur or decline : PM607 Strategic Management- Kaplan International Pathways. What decisions/strategies led to its failure/decline? Give an overview of their main competitors.
Identify and evaluate external influences : Identify and evaluate external influences in Economic Conditions that positively and negatively are affecting workforce needs in health care delivery
Find specific format for a person name : Many documents use a specific format for a person's name. Need to write a program whose input is: firstName middleName lastName, and whose output is:
Describe the principles of ethical leadership : Define and describe the principles of ethical leadership. Which two of the five covered in chapter, do you think are the most important? Why?
Determine the minimum and maximum parameters : If a legal integer was entered, check its value to see if it is within the provided minimum and maximum range (inclusive). If the user input was within the rang
Name two monetary and two non-monetary ways : AHS 7615 Topics: Administering Faith-based Human Services Assignment - The Monetary and Non Monetary Ways Discussion, Wilmington University
Worthiness of the franchise investment : Do you agree or disagree with your fellow student's conclusion on the worthiness of the franchise investment they selected and the financing option preferred?
Generate a list of suggested lottery numbers : This assignment will require that you generate a list of suggested lottery numbers using random number generation techniques.
Describe ethnocentrism and prejudice : Define culture and explain the terms related to culture. Define and describe ethnocentrism and prejudice. Give personal examples to support your descriptions.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program to input matrix

Write a program to input 4*4 matrix and display in array

  Create a program that displays a table consisting of ten row

Create a program that displays a table consisting of ten rows and four columns. The first column should display prices from $5 to $50 in increments of $5.

  Series of different lengths

Before you enter the series, you are to have the program ask the user how many marks there are. After the last mark is entered, show the average of the inputted marks, rounded to 1 decimal point. Test your program to ensure that it works for serie..

  Using the labor market, production function

Using the labor market, production function. and AS/AD graphs of the classical model, show the effects of an increase in the marginal product of labor. What are the effects on real wages, the quantity of labor, real GDP, and prices? Explain and show ..

  Create code using raptor flowchart programming

Demonstrate your analytical and problem-solving skills in analyzing a problem statement and providing your solution by developing a Raptor program that addresse

  Many bank atm machines have recently added the ability to

many bank atm machines have recently added the ability to dispense cash with- drawals in multiple bill denominations

  Write a program that will convert distance measurements

Write a C++ program that will convert distance measurements from miles to kilometers.

  What is the importance of creating own data types

What is the importance of creating your own data types? What are the benefits and drawbacks from developing your own data types?

  Create class has three pieces of information as data members

Create a class called Date in C++ that includes three pieces of information as data members: month (type int), day (type int) and yaer (type int).

  Create a program, using at least one for loop

Create a program, using at least one For loop, that displays the Sales Amounts made in each of 4 regions (North, South, East, and West) during a three month period.

  What does the expression pizza mean

What does the expression *pizza mean? What about taco[2]? How would you pass its address? What are the trade-offs of the two approaches?

  Write a recursive function print array that takes an array

(Print an Array) Write a recursive function print Array that takes an array and the size of the array as arguments, prints the array, and returns nothing.

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