Answered step by step
Verified Expert Solution
Question
1 Approved Answer
By the end of the assignment, you will be able to: Write an algorithm using the four algorithmic building blocks: sequence of steps, repetition, choice
By the end of the assignment, you will be able to:
Write an algorithm using the four algorithmic building blocks: sequence of steps, repetition, choice and subalgorithms.
Preamble
Using simple English sentences in the style of the example algorithms presented in class write algorithms for each of the following problems. Be sure to describe your algorithms accurately and explicitly. Assume that the person who reads your instructions does not understand the problem.
Type your algorithms into a word processor with your name and student number at the top. Use good indentation and spacing for readability.
Finally, remember the basic computer design rules and do not write code in any programming language!
Problem Statement
The problems:
A Many jam recipes measure the amount of fruit and white sugar required in cups, for example. Other recipes use kilograms of fruit and white sugar, for example. Give an algorithm that will determine which recipe uses more white sugar. Note: Pay attention to what type of sugar your recipe uses!
B Suppose you have a calculator with no square root button, but you really need to calculate What do you do You guess! Carefully of course.
For example, suppose you need to calculate You would first guess that is your answer. Definitely not close enough because is not close to A second better guess is which is Still not close enough because is not close to A third better guess is dots, which is still not close enough, but is closer! Keep going until your guess is accurate enough.
If a particular guess, is not close enough to being an accurate square root of a number we can produce a new and better guess by calculating For your algorithm, "accurate enough" means accurate to three decimal places.
LANGARA COLLEGE
COMPUTER SCIENCE
C Write an algorithm to determine whether it is cheaper for your instructor to purchase a Translink monthly pass for the month of February or to use Stored Value instead. Assume your instructor arrives immediately before his first class at Langara and returns to New Westminster immediately after his last class each day. Think about how you would generalize your algorithm so it will work for other instructors and other schedules and situations, too. ANSWER ALL
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