Jump to content

I need Help with school assignment

Mr Harris King, the owner of “King’s Variety Shop”, has asked your consulting firm to design an algorithm for a simple cash register system which will allow the cashiers at the shop to total the price of the items being bought by a customer, calculate the tax on each item and provide the final payable amount of the bill. The cash register system should then tell the cashier how much change is due back to the customer based on the amount of cash given to the cashier.

 

Points to Note:
1. Items belong to one of two categories VAT or non-VAT, and the system must accommodate for this:
a. VAT items incur a 10% tax;
b. Non-VAT items incur no tax.

2. The cashier will enter the category and the price of each item until all of a customer's items have been entered. (The system will have to check to determine that the last item has been entered).

3. Things to be displayed to the screen: subtotal before tax, final bill payable, and any change due.

4. The business accepts cash only. Therefore, at this point in time the required system does not have to deal with processing cheques or debit/credit cards. 

 

I need help with the Algorithm.

Link to comment
Share on other sites

Link to post
Share on other sites

What code can you code?

 

I would do it with QBasic. Doens't look that pretty, but is easy. 

 

Something like that? 

 

Input "a"

 

If "a" equals

 

V equals P*1,10 

N equals P

 

input P

 

Print P

 

...

Intel 4790k | Asus Z97 Maximus VII Impact | Corsair Vengeance Pro Series 16 GB 1866Mhz | Asus Strix GTX 980 | CoolerMaster G550 |Samsung Evo 250GB | Synology DS215j (NAS) | Logitech G502 |

 

Link to comment
Share on other sites

Link to post
Share on other sites

i know it's pseudo code but what language? 

It's an algorithm not pseudocode.

Link to comment
Share on other sites

Link to post
Share on other sites

What code can you code?

 

I would do it with QBasic. Doens't look that pretty, but is easy. 

 

Something like that? 

 

Input "a"

 

If "a" equals

 

V equals P*1,10 

N equals P

 

input P

 

Print P

 

...

It's an algorithm not pseudocode

Link to comment
Share on other sites

Link to post
Share on other sites

What about this is causing you trouble?

 

I won't write the algorithm for you, but I might be able to provide some advice on a specific issue.

Link to comment
Share on other sites

Link to post
Share on other sites

Algorithm for what exactly? Because I don't see any use of algorithms, except adding and calculating the taxes.

Link to comment
Share on other sites

Link to post
Share on other sites

You have the functional requirements there in those 4 points, you should write what you think would actually happen as a program in each of those

 

and try turning each of those 4 points into a function/method (whatever you like to call it).

 

eg:

1) an item is input and stored as a value, the value is checked to be either VAT or non-VAT, depending on this you store whether the item will need to be taxed (perhaps in a boolean), if you want, break it into something more psuedo code-like

 

once you know what needs happen, you can translate it into code

i7 3770 | Asus Z77 Pro | 16gb Kingston HyperX 1600 | Corsair AX750w | Steelseries 6Gv2 + Logitech G502


GPU: Asus R9 280x Direct CUII (complete with the famous VRAM issues/artifacts feature enabled)


stuck in elo hell, chillen with morello

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×