136k views
1 vote
Write a method named timesTen. The method should accept a double argument and return a double value that is ten times the value of the argument.

User Theotherdy
by
5.1k points

1 Answer

4 votes

Answer:

The code below is implemented using C++.

Step-by-step explanation:

#include <iostream>

#include <string>

using namespace std;

double timesTen(double num);

int main()

{

double num,tentimesnum;

int i=0;

cout << "Enter number: ";

cin >>num;

tentimesnum=timesTen(num);

int a = 1;

// while loop execution

while( a <= 10 )

{

cout << "value of "<< a <<": "<< tentimesnum << endl;

a++;

}

return 0;

}

double timesTen(double num)

{

return num*10.0;

}

User Nickgraef
by
5.4k points