question archive pseudocode for the following Problems
Subject:Computer SciencePrice:4.87 Bought7
pseudocode for the following Problems.
Problem 1: One Dimensional Array Processing: 20 Points
You work for Busch Gardens and your job is to calculate statistics about how many tourists visit each week to help supervisors staff the park adequately to meet tourist demands. You need to input the number of tourists attending into a one dimensional array and then calculate and write the average number of tourists, the lowest number of tourists, and highest number of tourists for the 7 day period.
· Your program must include 1 VALUE RETURNING FUNCTION called CalcAverage() that accepts 2 parameters/arguments for calculating the average and returning it to the main method.
· For loop(s) are required for processing arrays.
The program will run like this where the user input is bolded and italicized and the output report begins with Attendance Analysis. The output report should only print right before the program ends. Your program should run for any data given and not just the test data shown below.
Please enter the attendance for Sunday: 65000
Please enter the attendance for Monday: 60000
Please enter the attendance for Tuesday: 50000
Please enter the attendance for Wednesday: 52000
Please enter the attendance for Thursday: 52500
Please enter the attendance for Friday: 62000
Please enter the attendance for Saturday: 68000
Attendance Analysis:
The Average Attendance is 58500.
The Lowest Attendance is 50000
The Highest Attendance is 68000
Problem 2: Writing a Function/Method
The Everything Is A Dollar store is having a once in a year sale where all items in the store that normally sell for 1 dollar are discounted by 10%.
1. After the main() method ends, write a value returning function called setDiscountAmount that returns the discountAmount.
2. In the main() method, call the setDiscountAmount() function. You have to determine the variables that should be passed within the () to the setDiscountAmount() function to calculate the discount amount correctly.
3. In the main() method, calculate the price after discount.
4. In the main() method, display the original price, the discount amount, and the price after discount.
main()
Declare Real price = 1.00 //Everything costs $1.00 in the store
Declare Real discountRate = .10 //This is 10% converted to a decimal
Declare Real discountAmount = 0.00 //You must calculate the discountAmount
Declare Real priceAfterDiscount = 0.00 //You must calculate the priceAfterDiscount
Display "Use the Everything Is a Dollar Discount Calculator"
//complete program. The solution requires less than 10 lines of code.
Problem 3: Writing a Decision Structure
A pizza truck that sells only cheese pizza uses the following pricing rules:
Pizza Size: Small $1.50 per Slice $8.00 per Pie Medium $1.75 per Slice $10.00 per Pie Large $2.00 per Slice $12.00 per Pie You are tasked with building a user friendly app that allows the user to order pizza from the truck. Your app must then display the price. Pizza Size (S, M, L) Type Code (S to order a slice. P to order a pie.) Quantity (User can order a maximum of only 1 pie at a time. User can order a maximum of 8 slices at a time.) Given the following code, complete the Decision Statement that sets the price for an order then display the price. main() Declare String size Declare String type Declare Integer quantity Declare Real price Display "Please enter the size (S, M, L):" Input size Display "Please enter the type (S for Slice or P for Pie): " Input type Display "Please enter the quantity (1 for a pie, or 1 to 8 for slices): " Input quantity //Finish the program. The solution requires less than 25 lines of code
Purchased 7 times