Write a program that uses recursion to determine one age

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

1. Write a program that uses recursion to determine one's age. The user will enter the current year and the year they were born (birth year) from the keyboard. The program will output the current age of the user. Check positive and zero cases only. A recursive function must be used for full credit. No recursive helper functions may be used as well. Output should be user friendly.

Name the program:
TestRecAgeXX.cpp, where XX are your initials.

2. The two sets of output below show the results of successive circular rotations of a vector. One set of data is for a vector of integers, and the second is for a vector of strings.

1  3  5  7

3  5  7  1

5  7  1  3

7  1  3  5

a  b  c  d  e

b  c  d  e  a

c  d  e  a  b

d  e  a  b  c

e  a  b  c  d

Write two template functions that can be used to rotate and output a vector of a generic type:

void rotateLeft(vector <T>& v)
void output(vector <T> v)

The first function performs a single circular left rotation on a vector, and the second prints out the vector passed to it as a parameter. Write a test program that will test the two functions by generating output similar to above. Use element types of int,double,char and string. Must use templates and function headers above for full credit. Use C++ string class. Output should look similar to the text.

Name the program:
TestRotateTemplateXX.cpp, where XX are your initials.

Reference no: EM131065457

Questions Cloud

-what is the probability that demand will exceed 1000 pounds : -What is the probability that demand will exceed 1000 pounds?
What is the probability that at least one line stalls : What is the probability that at least one line stalls at least once in any given week?
How much interest will cooper have earned after 6 months : How much interest will Cooper have earned after 6 months?ste your question here...
A leader acting in an unethical manner : Without including names, describe a situation in which you have witnessed a leader acting in an unethical manner. What effect did the leader's actions have on organizational or team proformance?
Write a program that uses recursion to determine one age : Write a program that uses recursion to determine one's age. The user will enter the current year and the year they were born (birth year) from the keyboard. The program will output the current age of the user. Check positive and zero cases only.
Calculate a confidence interval under the full factorial : Assuming a 5% reactivation rate, calculate a confidence interval under the full factorial, as well as the reduced factorial design (your matrix A and Matrix B above) and discuss the difference in precision or the width of the confidence interval.
Write a reservation system for an airline flight : Write a reservation system for an airline flight. Assume the airplane has 10 rows with 4 seats in each row. Use a two dimensional array of strings to maintain a seating chart. In addition create a array to be used as a waiting list in case the pla..
Determine the approximate number of american adults : determine the approximate number of American adults who would find giving up their phone more difficult than giving up their partner. Approximately nothing American adults who would find giving up their phone more difficult than giving up their pa..
Analyze the significance of the concept of leadership : 1. Analyze the significance of the concept of leadership and the different leadership styles. 4. Illustrate the role of ethics and values in guiding organizational behavior.

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