Create a Program Code Pseudocode Task
ANSWER
Here’s a pseudocode program that allows the troop leader to enter the number of boxes of cookies sold by each scout and calculates the total number of boxes sold, as well as the mean and median values:
1. Initialize an empty list called "cookie_sales" to store the number of boxes sold by each scout.
2. Initialize a variable called "total_boxes_sold" to 0 to keep track of the total number of boxes sold.
3. Initialize a variable called "mean" to 0 to store the mean value.
4. Initialize a variable called "median" to 0 to store the median value.
5. For each scout in Girl Scout Troop 815:
a. Ask the troop leader to input the number of boxes of cookies sold by the scout and store it in a variable "boxes_sold".
b. Append "boxes_sold" to the "cookie_sales" list.
c. Add "boxes_sold" to the "total_boxes_sold".
6. Sort the "cookie_sales" list in ascending order.
7. Calculate the mean:
a. Divide "total_boxes_sold" by the number of scouts (which is 18) and store the result in the "mean" variable.
8. Calculate the median:
a. If the number of scouts (18) is even:
i. Find the two middle values in the sorted "cookie_sales" list (at indices 8 and 9).
ii. Calculate the average of these two middle values and store it in the "median" variable.
b. If the number of scouts (18) is odd:
i. Find the middle value in the sorted "cookie_sales" list (at index 9) and store it in the "median" variable.
9. Display the following information:
a. Total number of boxes sold: "total_boxes_sold".
b. Mean value: "mean".
c. Median value: "median".
This pseudocode outlines the logic for your program. You can implement it in a programming language of your choice by translating these steps into actual code.
QUESTION
Description
Girl Scout Troop 815 has 18 members. Write a program in which the troop leader can enter the number of boxes of cookies sold by each scout, and output the total number of boxes sold and the mean and median values. Pseudocode only
![Place Your Order Here](http://scholarywriters.com/wp-content/uploads/2023/08/Bottom-of-every-post.png)