179k views
4 votes
Write the pseudocode for a function named timesTen that accepts an Integer argument. When the function is called, it should return the value of its argument multiplied times 10. Write a main module that asks the user to enter a number, call the timesTen function, passing in that number as and argument, receives the return value, and displays the returned value in a user-friendly message.

1 Answer

2 votes

Answer:

function timesTen (number):

return number * 10

n = int(input("Enter an integer: "))

print(str(n) +"x10 is equal to: " + str(timesTen(n)))

Step-by-step explanation:

Pseudocode is the representation of an algorithm. It shows the steps of the algorithm combination of the English and programming language.

In the pseudocode, we said we will be defining a function called timesTen that takes one parameter and returns the value of its parameter multiplied times 10.

In the main, we asked the user to enter a number. Then, we called the function with that number, and print the result.

User Azaz Ul Haq
by
4.8k points