Write a recursive function to display digits of an integer

Assignment Help C/C++ Programming
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.

Reference no: EM131477489

Questions Cloud

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.

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