Skip to content

sibar9bit/java-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Exercise

This is a simple exercise done by Mehmet Sibar. The application can run via command line. It will ask a few questions to fill the shopping cart. At the end of it, the application should show your cart and the total price.

It's best to run the test to see how the application performs.

The command-line interface has not designed very well as the main focus is the code quality and logic.

Specification

A local shop, Henry’s Grocery, has asked you to author an IT solution for them to price up a basket of shopping for their customers.

Henry’s Grocery, currently only stocks four items and has two promotions. These are as follows:

Stock Items

product unit cost
soup tin 0.65
bread loaf 0.80
milk bottle 1.30
apples single 0.10

Discounts

the offer valid from valid to
Buy 2 tins of soup and get a loaf of bread half price yesterday for 7 days
Apples have a 10% discount from 3 days hence until the end of the following month

Tests

  • Price a basket containing: 3 tins of soup and 2 loaves of bread, bought today,
    • Expected total cost = 3.15;
  • Price a basket containing: 6 apples and a bottle of milk, bought today,
    • Expected total cost = 1.90;
  • Price a basket containing: 6 apples and a bottle of milk, bought in 5 days time,
    • Expected total cost = 1.84;
  • Price a basket containing: 3 apples, 2 tins of soup and a loaf of bread, bought in 5 days time,
    • Expected total cost = 1.97.

About

Fun things and other challenges

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 52.1%
  • Java 31.7%
  • JavaScript 9.4%
  • CSS 6.8%