[Tutor] I need help with my project

Alan Gauld alan.gauld at yahoo.co.uk
Wed Nov 28 08:20:31 EST 2018


On 28/11/2018 00:30, Treyton Hendrix wrote:
> If the user selected a sandwich, french fries, and a beverage, reduce the
> total cost of the order by $1.00.
> 
> This is what I have to do and I don't know where to start.

Neither do we because we don't know what you are talking about.
There is no context.

How does a user select these items? Is it a web page? a GUI? A CLI?
An in-store sensor that detects items being removed from the fridge?
(Maybe under the control of a Raspbery Pi or Arduino?)

And how do you know the original prices? Are they hard coded?
read from a data file or database? Input by the user? Or maybe the
fridge sensor reads bar codes attached to the actual items?

How do you calculate the total? Is it stored in a variable?
Is it stored as a floating point value (you should never do
that for money!) or as an integer number of pennies/cents?

If the latter

total -= 100

Is the obvious answer to your question.

Is it even in code or do you just write it down on paper?
Or maybe you are using an electronic calculator?

I could go on but hopefully you see how little information
you have given us to work from.?

If it is in code show us what you hae so far and we can
help you add this feature. Without any clue what you are
doing we can't really help very much.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list