In: Computer Science
A bug collector collects bugs every day for seven days. Design a program that keeps a running total of the number of bugs collected during the seven days. The loop should ask for the number of bugs collected for each day, and when the loop is finished, the program should display the total number of bugs collected. Finally, compute and display the average number of bugs collected. You should have 2 functions defined:
Write the Pseudocode OR a raptor flowchart for the Bug Collector program described above.
Here there are two functions
one is main function and the other is the collectBugInfo function
We collect BugInfo of 7 days and calculate total bugs and average of them in collectBugInfo function
After creating this two flowcharts press function key f10 to execute step by step.
When the input box comes it will pop a window to enter bug of each day.
After 7 days are finished it will calculate sum and average and print them and ends
(Start executing from main flowchart)
main function flowchart using raptor:
collectBugInfo function flowchart:
Here I entered 2,4,6,8,10,12,14 as the bugs from day 1 to 7
SO the total bugs here are 56 and average of bugs is 56/7 = 8
O/P: