Asked Sep 9, 2019

In C++

Create two functions called TheNumber. One version of TheNumber should accept a string and output the accepted string 10 times.  The other version of TheNumber should accept a double and output the accepted double 10 times. This uses function overloading.


Expert Answer

Step 1

Program code in C++ for creating two functions called TheNumber. One version of the TheNumber function accepts a string and displaying output of the accepted string ten times and the other version is accepting a double number and displaying the output the of accepted double ten times, by using function overloading.

Step 2

Program code:

#include <iostream>

#include <string>

using namespace std;

//Defining function to accept string

void TheNumber(string s)


    for(int i = 0; i < 10; i++)


        cout << s << endl;



// Defining function to accept double

void TheNumber(double number)


    for(int i = 0; i < 10; i++)


        cout << number << endl;



//Declaring main function

int main()



Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in


Computer Science

Programing Language

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add

Q: In C++ Create a function called DieRoll. It should create a random number between 1 and 6 and return...

A: Program AlgorithmDeclare the variable and declare the function prototype as int DieRoll(int low, int...


Q: Why does Pinterest view Google as its primary competitor? Why does Pinterest focus on the smartphone...

A: Pinterest is a social media platform whose software system is designed to find and curate informatio...


Q: Complete the following list comprehensionlc5 = [ for c in 'bu be you']so that it produces...

A: Let’s define a python function which outputs True if the alphabet is ‘b’ or ‘u’, because the above l...


Q: Create a new file in c++.  In this lab, you will add some functionality to the table ofmenu. Your bo...

A: Program Instructions:Declare variables and write a welcome message.Always convert the user's choice ...


Q: What is the reason that JK flip flop is often preferred over SR flip flop?

A: SR stands for SET / RESET. SR flip flop is considered as one of the most basic sequential logic circ...


Q: Please write Lisp code for the following problem. Consider the list:((name (number1 nation)) (MusicP...

A: Instructions to create a function to access the MovieTixHighPrices value using car and cdr:The funct...


Q: What does the group nesting depend on?

A: Group Nesting:A group can have any number of contacts, users, or other groups as members. And the ne...


Q: Write a program called LoopMinMax that reads in 4 values from the user and prints the lowest and hig...

A: You didn’t mention which language should be used for the given program. Here, I have used JAVA langu...


Q: Hello! I am trying to write a program in Pynthon. Need help. Requirements: Write a .py file like Kev...

A: Program Plan:Import required packagesPrompt the path and the number of characters to delete from the...