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