Question
1-4. Design detailed algorithms for the following problems. Your algorithm must have at least 4 to 5 steps and be clear. Please refer to chapter
1-4. Design detailed algorithms for the following problems. Your algorithm must have at least 4 to 5 steps and be clear. Please refer to chapter 1 examples and write only algorithms in either pseudocode or step-by-step descriptions. 1. Design an algorithm to find the weighted average of four test scores. The input data needs to be read in as a series of score-weight pairs. For example, this sample input data corresponds to a weighted average of 80: 80 0.20 90 0.20 85 0.10 75 0.50 Be sure to initialize any variables to zero when necessary. 2. Write an algorithm to prompt for and then read in the radius, in inches, and price of a pizza; then, compute and output the price of the pizza per square inch. 3. Chris and Terry have opened a new lawn service. They provide three types of services: mowing, fertilizing, and planting trees. The cost of mowing is $40.00 per 5000 square yards, fertilizing is $35.00 per application, and planting a tree is $50.00. Write an algorithm that prompts the user to enter the area of the lawn, the number of fertilizing applications, and the number of trees to be planted. The algorithm then outputs the billing amount. (Assume that the user orders all three services.) 4. Design an algorithm to find the roots of a quadratic equation of the form ax2 + bx + c. First prompt for floating-point values a, b, and c. If a is zero, output a message that the input values are invalid; otherwise, if there are no real roots output a message that there are no real roots; otherwise output both roots
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started