Determine the larger and smaller integers

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

Write a C++ program that will use loops to perform each of the following tasks:

1. Ask the user for two characters from the keyboard and read them into char variables.

Determine which input is larger and which is smaller.

Write out all of the characters between smaller and larger including both end points (the input characters) in small to large order.

Example: input of (d k), output of (d e f g h i j k)
Example: input of (R M), output of (M N O P Q R)

2. Ask the user for two integer values and read them into int variables.

Determine the larger and smaller integers.

Write out every second integer, starting with the larger one and stopping at the lower one. (note: if one number is even and one is odd, the lower value will not show up in the output).

Example: input of (13 5), output of (13 11 9 7 5)
Example: input of (13 6), output of (13 11 9 7)

3. Ask the user for an integer in the range of 1 to 10, and read the value into an int variable.

Use a loop to check if the user's input was in the correct range.

If the input value was not in the 1-10 range, write out an error message, prompt the user for a new value, and read in this new value. Repeat this process until a value in the correct range is found.

Use another loop to calculate the factorial of the input value. (factorial can be found by multiplying together all of the integers from 1 up to your number, so 4! can be calculated as 1*2*3*4 in a simple counting loop)

Output the input value and the calculated factorial value with a text message  (i.e. "4! is 24")

4. Ask the user if they would like to repeat the program (all of the preceding steps (steps 1-3) and read in their response.

If the user chooses to repeat, then repeat steps 1-4
If the user chooses not to repeat, write out a goodbye message and let the program end.

Reference no: EM131207861

Questions Cloud

How did case become customer driven : In 1995 Case became Case IH, consolidating International Harvester with Case. Tenneco's decreased ownership in Case resulted in Case becoming 79% publicly owned.
Deepest recessions in history-the great depression : If we compare the two deepest recessions in history-the Great Depression and the recession of 2009-they both had a huge impact on the economy, but both of them were handled very differently by governments. The policies governing trade after the 20..
Compute the 2013 tax liability for charlotte : Charlotte is a surviving spouse and provides all of the support of her four minor children who live with her.- Using the Tax Rate Schedules, compute the 2013 tax liability for Charlotte.
What key competitive dimensions are driving sales : Consider the two categories of products that Timhuk2 makes and sells. For the custom messenger bag, what key competitive dimensions are driving sales? Are the company's competitive priorities different for the new laptop bags sourced in China?
Determine the larger and smaller integers : Determine the larger and smaller integers. Write out every second integer, starting with the larger one and stopping at the lower one. (note: if one number is even and one is odd, the lower value will not show up in the output).
Servant leadership models and other models : What are the most significant differences between servant leadership models and other models? Define the paradox of servant leadership and explain where you see this paradox present in your own representation.
What is the breakeven point for jane corporation : Jane Corporation produces model toy cars. Each sells for $29.99. Its variable cost per unit is $14.25. Assuming it has a fixed cost of $314,800. What is the breakeven point for Jane Corporation?
Develop at least five major goals for the it strategic plan : Develop at least five major goals for the information technology strategic plan. Speculate on three positive organizational impacts of implementing the strategic plan. Justify your response.
Life cycle theory to foreign direct investment : Explain fully the advantages of expanding across borders??1 2. Distinguish in detail the reasons and advantages of expanding into different nations through mergers and acquisitions, as opposed to greenfield investments.??13. Discuss in detail the ..

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