Reference no: EM131477489
C++ Assignment
In this assignment you will be writing several functions to practice your skills in writing recursive functions and using stacks/queues.
First, start by writing and testing the following functions:
1. Write a recursive function to display the digits of an arbitrary integer in reverse order. That is, if called with the integer 2364, it would display 4 6 3 2.
2. Write a function that takes in a string and reverses it using a stack. Use an STL stack.
3. Write a recursive function that performs selection sort. Each recursive step should perform another pass on the array.
4. Write a recursive function that performs bubble sort. Each recursive step should perform another pass on the array.
Then, in your main body, test these programs.
1) Read in a number from the user. Call your reverse function and output the integer in reverse.
2) Prompt the user for a string, reverse it with your function and output it to the screen.
3) Create an array of 10 random numbers, display it to the screen, then sort it with your recursive selection sort. Then output the results to the screen.
4) Create a new array of 10 random numbers, display it to the screen, then sort it with your recursive bubble sort and output the results to the screen.
What does bond rating say about potential default risk bond
: What is the priority of claims on the assets of the issuer for secured debt, debentures, and subordinated debentures?
|
Locate a free online self-discovery assessment
: Locate a free, online self-discovery assessment (e.g., career, personality, values, preferences) and take the assessment to receive your results.
|
Write a program that will take in a unsigned short integer
: Write a program that will take in a unsigned short integer and then swap the contents of the upper eight bits with the lower eight bits.
|
What is the meaning of default risk and call risk
: What are the three adjustments needed to convert the formula for an annual-pay bond into a semiannual-pay bond?
|
Write a recursive function to display digits of an integer
: Write a recursive function to display the digits of an arbitrary integer in reverse order. That is, if called with the integer 2364, it would display 4 6 3 2.
|
What does the term positive convexity mean
: Why does a zero coupon bond typically sell at a discount to its par value?
|
Soviet union rapid industrialization
: What arguments does Stalin make for the Soviet Union's rapid industrialization?
|
Define the premium bond
: If a bond has a coupon rate that exceeds its required rate of return, should the bond sell at a discount or a premium? Why?
|
The whites invade harlem
: "The Whites Invade Harlem," is his recollection of certain aspects of life in Harlem during this era.
|