7. In the following question, we will practice writing loops and functions. (a) Create a variable named a and set it equ
Posted: Mon Jun 06, 2022 2:20 pm
question, we will practice writing loops and functions. (a) Create a variable named a and set it equal to 5. Create a variable named b and set it equal to 3. Print (or display) the product of a x b. (b) Write a loop which prints the value of a x b as long as the value of b is strictly less than the value of a. On each loop decrement (reduce) the value of a by 1. (c) Write a function which takes two parameters (a and b). The function should print the same values as Question 7b, i.e. as long as b is strictly less than a, it should print the product of a x b, decrementing the value of a after each calculation. Your function should return the last calculated product. (d) Call to the function you wrote in Question 7c, passing the originally specified values of a (5) and b (3). Save the output as a variable named final. (e) Write a conditional statement. If the value of final is greater than or equal to 10, print the value of final Otherwise print the text, "Less than 10."
7. In the following