# need help with an assignment

• March 21st, 2013, 12:21 PM
milham123
need help with an assignment
Objective:
 Determine the goal and the items that are needed to achieve that goal.
 Design solution using Step from Algorithm and Flowchart, Desk check your algorithm
 Implementation using Java, Debug and execute

Problem Specification:
The owner of the Lunch Cafι aims to sell daily a reasonably-priced three-course lunch to the local student community. To save costs, each day there is only a single choice of starter, main course and dessert. As with most establishments of its kind, the largest profit comes from selling the main courses. Unfortunately, the local students being frugal, hard-working and cost-conscious tend to only order a starter and/or a dessert.
As an incentive to order main courses, the owner has decided  where customers order a main course  to provide, free of charge:
 a soft drink if they also order a starter;
 coffee if they also order a dessert;
 both a soft drink and a coffee if all 3 courses are ordered.
If customers do not order a main course or if they only order a main course, then there are no drinks provided.
You are to write a program that advises staff what to provide. The program should ask what course(s) the customer is ordering and output what is to be provided. The choices are:
 starter at RM3
 main course at RM6
 dessert at RM4
 soft drink at RM1.5 (free only if both a starter & a main course have been ordered)
 coffee at RM2 (free only of both a dessert & a main course have been ordered)

1. Design solution using Step form Algorithm / flow chart. (10 marks)
2. Desk check your algorithm with reasonable inputs (10 marks)
3. Implementation using Java (30 marks)
4. Debug and execute.
• March 21st, 2013, 12:31 PM
Norm
Re: need help with an assignment

What have you tried?
• March 23rd, 2013, 03:14 PM
StephenCoyle
Re: need help with an assignment
Start here - Tasks to do 1. Design solution using Step form Algorithm / flow chart.

Using Stepwise Refinement - A way of developing a computer program by first describing general functions, then breaking each function down into details which are refined in successive steps until the whole program is fully defined.

Example of stepwise refinement :

Set the search result to false
Start at the beginning of the list
For each item in the list
if the list item matches the item we are looking for
let the search result = true
end -if
end - for
display the search result state