Prompts the user to enter an integer

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

Step 1. Write the code that prompts the user to enter an integer between 1 and 20 (including 1 and 20), reads the value using cin, and then prints the value that they entered in a statement that begins with "You entered a ". Save this version in a separate location so that you can submit it.
Step 2. Add more code or modify your code so that if the user enters a value that is less than 1 or greater than 20, it prints out "The value you entered is not between 1 and 20." Otherwise, and only if the value is between 1 and 20, it prints the statement as before. Save this version in a separate location so that you can submit it.
Step 3. Add more code or modify your code so that if the user enters the values 8, 11, or 18, the statement that is printed is "You entered an" instead of "You entered a". Save this version in a separate location so that you can submit it.
Step 4. Add more code or modify your code so that if the users something that is not a number, i.e. includes letters, your program does not print any of the above lines, but instead prints out "Idiot! Your input could not be read as a number. Get a life!". As mentioned in the previous assignment, you can test to see if the previous cin failed to read a value by calling cin.fail()

Reference no: EM13159255

Questions Cloud

Compute and use standard deviations from the samples : state the hypotheses and identify the claim. compute the test value At a = 0.05, decide if there is enough evidence to reject the claim of no difference in the ages fo the two groups. Compute and use the standard deviations from the samples.
Amount of gain-straight line method : P Company continued to depreciate the equipment over its 9 year remaining life using the straight-line method. This equipment was sold to a third party on January 1, 2011 for $1,440,000. What amount of gain should P Company record on its books in ..
Offset of volcanic formation : Measure the offset of this volcanic formation using the map and distance scale in Figure 3. Then calculate an estimated average annual rate of movement in centimeters per year along the San Andreas Fault
What is the pressure in the container : If 2.61 g of methane gas (CH4) is introduced into an evacuated 1.67 L container at 15°C, what is the pressure in the container?
Prompts the user to enter an integer : Write the code that prompts the user to enter an integer between 1 and 20 (including 1 and 20), reads the value using cin, and then prints the value that they entered in a statement that begins with "You entered a ". Save this version in a separate l..
Does confidence interval interpretation agree with results : Find the 90% confidence interval fo the mean. Does the confidence interval interpretation agree with the hypothesis testing results? Explain.
Determine the heat of combustion of ethylene : The bond energies are: C H 416 kJ/mol; C C 356 kJ/mol; C C 598 kJ/mol; O O 498 kJ/mol; C O 803 kJ/mol; H O 467 kJ/mol.determine the heat of combustion of ethylene ?
What is real or physical and evidence : What is real, or physical, evidence? Describe. ?Provide 3 examples of a piece of real evidence. ?What is the importance of physical or real evidence to the investigation?
Explain what alternatives choose to increase profits : Decrease your sales price by $5 in order to increase sales by 5,000 units. Which of the above alternatives would your choose to increase profits?

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