Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please solve using python #Question 3 def getUserInput(): Return a floating point number obtained with active user input This function asks the user
Please solve using python
#Question 3 def getUserInput(): " " "Return a floating point number obtained with active user input This function asks the user to input a number. If the input given is not acceptable the function keeps asking for the input until a valid input (any number) is given. Convert the input number to a floating point number Arguments: none Returns: A floating point number return False def getIntegerComponent (inputNumber): " " "Return the integer component of a number Isolate the integer part of the number Arguments: inputNumber : a floating point numbe:r Returns: An integer >>>getIntegerComponent (3.899) >>>getIntegerComponent (-4.56) return False def printFavoriteNumber (num): "" "Print the input number a random number of times Generate a random integer n (between 1 and 20), and the print the following line: "We will print your favorite number n times using the value of n Then print the following n times "Your favorite number is num" using the value of num Arguments: num : a number Returns nothing >>> printFavoriteNumber (3.5) #the following lines will be printed "We will print your favorite number 2 times" "Your favorite number is 3.5" "Your favorite number is 3.5 return False def getAndPrintFavNum(): "" "Print the user's favorite number a random number of times Call the function getUserInput to get a number, then use that numbeir as the input parameter to call the function getIntegerComponent to get an integer, and thein use that integer as the input parameter when calling the function printFavoriteNumber Arguments: none Returns: nothing return FalseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started