Reference no: EM13161428
Design and develop an algorithm (using sequence, selection and iterative constructs) that we find in daily life and independent of computers.
Task
As you have been studying so hard for the last several weeks, you haven't had enough time for laundry chores. As your laundry basket is full of clothes in need of washing, you must do at least two loads of washing.
With respect to a full laundry basket of your clothes and the washing machine that is normally used to wash your clothes, design and develop an algorithm to wash your clothes. Ensure that your algorithm is complete and has sufficient details.
- Don't mix your whites and colours. Don't assume your clothes sort by themselves.
- Don't assume your clothes magically fly from the basket to the machine.
- Don't assume that the machine turns on by itself.
- Don't assume the machine empties by itself.
- Etc.
Question-2
- develop simple numeric algorithms such as min, max, count and average.
Task
Develop an algorithm to prompt for and obtain maximum daily temperatures for a whole
year. However, in order to consider leap years, your algorithm should first prompt the user
for the number of days in this particular year. That is, your algorithm should expect 365 or
366 as the first input number followed by input temperature values.
In addition, for this particular year, your algorithm must also determine and display the
average, maximum, and minimum of these temperatures values.
Question-3
Assessing this question focuses on whether students can demonstrate the ability to:
- develop sequentially cohesive modules,
- develop functionally cohesive modules,
- develop modules utilising data coupling, and
- develop modules utilising stamp coupling.
Task
A photographic business has a particular data file containing some characteristics associated with wedding albums; these albums must be produced and delivered to customers.
Each line of this file contains data for an individual wedding album and delivery. These data are used to determine the total cost of producing and posting a batch of albums to a customer. Each column of this file contains values for the following characteristics: cover type, size, the number of colour pages, the number of black and white pages, the number of copies ordered in this batch, and postcode. For example, the first few lines of this file might contain:
Soft A3 20 4 3 4321
Soft A4 26 4 2 3210
Leather A4 40 10 1 4567
Hard A5 100 20 2 2109
Your algorithm is to calculate and display the cost of producing and delivering a batch of
wedding albums. That is, an overall cost must be computed for each line of this file. This cost
depends on the type of cover (soft, hard, or leather), the album size (A3, A4 or A5), the
number of colour pages, the number of black and white pages, the number of copies, and
postage.
The cost of producing and delivering albums is based on the following costs. In addition, if the overall cost is above 200 AUD, apply a 10% discount.
- Soft cover 10 AUD
- Hard cover 15 AUD
- Leather cover 25 AUD
- Each A3 colour page 3 AUD
- Each A4 colour page 2.5 AUD
- Each A5 colour page 2 AUD
- Each A3 B/W page 2 AUD
- Each A4 B/W page 1.5 AUD
- Each A5 B/W page 1 AUD
- postage per A3 album = 15 + (0.08 x total number of page) + postcode cost
- postage per A4 album = 9 + (0.04 x total number of page) + postcode cost
- postage per A5 album = 5 + (0.02 x total number of page) + postcode cost
A postcode cost is based on the following:
- Postcodes beginning with a 2 incur an extra 4 AUD cost per album
- Postcodes beginning with a 3 incur an extra 3 AUD cost per album
- Postcodes beginning with a 4 incur an extra 5 AUD cost per album
- All other postcodes incur as extra 10 AUD cost per album
Based on these file values, one can expect the output of your algorithm to be:
269.78 AUD
188.40 AUD
156.00 AUD
443.52 AUD