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

  Define the operations using peano arithmetic

Write five tests for each using numbers larger than 100 and verify using natZint and intZnat that your numbers work the same way as the usual natural numbers.

  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..

  Questionnbsp the template method pattern and the strategy

questionnbsp the template method pattern and the strategy pattern both abstract some computation in the form of

  Design a deck plan space ship in eclipse

Develop a simple interactive two-dimensional spaceship deck plan editor using OpenGL and GLUT. Your program will enable a user to create and save a deck plan of a hypothetical spaceship comprising the hull walls.

  Write a c++ program to choose two three-digit primes

Write a C++ program to choose two three-digit primes and an encryption exponent (3 or 17 may do nicely).

  Determine the rate of heat loss from the absorber plate by

some at plate solar collectors change their tilt angle throughout the day in order to intercept the maximum amount of

  What are the primary differences between object-oriented

1. what is instruction explosion?2. what are the primary differences between object-oriented programming languages and

  Practice with c functions

This homework will give you practice with C++ functions as well as string manipulation.

  Create a procedure that returns the last n items in the list

Create a procedure that returns the last n items in the list lst. Create a procedure called (combine-four lst1lst2 lst3 lst4) that combines 4 lists into one list, in order of the given input lists.

  Modify the program to detect and report

Syntax errors including mismatched parentheses, invalid operator, missing comma, semicolon or assignment operator should be reported as a syntax error and the program should proceed to the next expression.

  Ansi-c program complete assignment as per written in the

complete assignment as per written in the attached

  Explain use of access modifiers for methods and variables

Explain use of access modifiers (public, private, ...) for your methods and variables.

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