Answer:
Following are the program in the Python Programming Language.
# Define the function
def Sum(tu):
# Check if the tuple contain 0
if len(tu)==0:
#Then, Return 0
return 0
#Otherwise
else:
#call the recursive function
return tu[0]+Sum(tu[1:])
#Set tuple type variable
tu=(2,5,1,8,10)
#print and call the function
print("The sum of tuple is:",Sum(tu))
<u>Output:</u>
The sum of tuple is: 26
Explanation:
Here, we define a function "sum()" and pass an argument "tu" which stores the tuple type value, inside the function.
- Set the if conditional statement to check condition is the length of the tuple is 0 then, return 0.
- Otherwise, call and return the sum of the tuple which is recursively calculated and close the function.
Finally, set the tuple type variable "tu" and initialize the value in it then, print and call the function sum.
The flow chart would go:
----------------------------
Start
Input C (Celsius)
IF C = -999 THEN END
Calculate F (Fahrenheit) using the formula
Output F
Goto next temperature (Input C)
----------------------------
The above needs tidying up and coding in the computer language you are using.
The Format Painter option.
When you want to apply cell formatting to a cell or a range of cells, it is much easier to use the format painter. This tool is found on you toolbars with a picture of a paintbrush. To use the format painter, select the first cell or range of cells, click the Format Painter on the Home tab and paste the conditional formatting by dragging the paintbrush across the cell or range of cells you want to format.