Book name is Starting Out with Programming Logic and Design (5th Edition)
Chapter 6: Functions
Algorithm Workbench
1. Design a simple function named timesDozen that accepts an Integer argument into a parameter named nbr. When the function is called, it should return the value of its argument multiplied times 12.
2. Assume that a program has two String variables named alpha and bravo. Write - a pseudocode statement that assigns an all uppercase version of alpha to the bravo variable.
I have created function in python.
1.
#takes integer argument nbr
def timesDozen(nbr):
#multiply nbr with 12
ans = nbr * 12
#return ans
return ans
#prints the value returned by timesDozen function
print("Answer: ", timesDozen(5))
2.
alpha = "hello"
#upper method convert the string alpha into upper case
bravo = alpha.upper()
print(bravo)
Get Answers For Free
Most questions answered within 1 hours.