Build a pseudocode for scenario an MCQ Assignment sheet of Descriptive Statistics to finish before tomorrow morning. the sheet only includes only 1 type of Question but with Different data fields in each question.
Question - Distance of top of bars from X-axis is given to you. Plot the Graph for given data and find the Volume of Graph that can be filled with any fluid.
You don't want to do the same calculation so many times since you're short on time. So you decide to write an algorithm that calculates the Volume of a graph.
Note - Assume an elevetion Graph where width of each bar is 1.
Start
Input:
Deadline \\ tomorrow morning
Question: 'Distance of top of bars from X-axis is given to you. Plot the Graph for given data and find the Volume of Graph that can be filled with any fluid'.
Input
array d(n) \\ Distance of top of bars from X-axis
w=1 \\ width of each bar
V=0 \\ initial volume
for i from 1 to n \\Calculate the Volume of a graph
"V=V+2\\pi d"[i]
Output:
V \\Volume
End
Comments
Leave a comment