• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

A java problem related to shopping mall

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please find that below is my problem. I want a solution for this problem. I am a fresher newly learning Java technology. Please anyone can help me in completing my assessment.

This shopping season you are having fun at the Mall. The Mall
owner, himself, is quite stressed out having to manage the
influx of customers.
He is struggling to calculate the discounts that he has on his
clothing line. You decide to help him out by building a system
that calculates the discounts on all the applicable items a
customer has bought.
There are several categories of products. In fact, categories
have subcategories which themselves can have subcategories.
Below is a diagram.
Casuals is a subcategory of Trousers, which by itself is a
subcategory of Men's wear. Some categories have discounts.
Men's wear Women's wear (50% off)
|- Shirts |- Dresses
|- Trousers |- Footwear
|- Casuals (30% off)
|- Jeans (20% off)
Each product you have belongs to a brand which by themselves
are running discounts. Below is a table that lists them:
Brands Discounts:
Wrangler 10%
Arrow 20%
Vero Moda 60%
UCB None
Adidas 5%
Provogue 20%
This way, a product can have three types of discounts
applicable:
1. Discount on the brand
2. Discount on the category
3. Discount on the ancestor category (e.g. Footwear doesn't
have a discount, but it's parent category Women's wear has 50%
off). It is worth noting, that it is an ancestor: not just a
direct parent, anyone in the lineage.
The discount that is applied is the greatest of the above
three. For example, if the customer buys a Jeans of Wrangler
Brand, the discounts are:
1. Discount on brand: 10%
2. Discount on category (Jeans): 20%
3. Discount on parents (Trousers, Men's wear): None
So, the discount that is applied 20%.
Inventory (the list of items that shop has):
===========================================================
Id | Brand | Category | Price | Discounted Price |
===========================================================
1 | Arrow | Shirts | 800 | 640 |
2 | Vero Moda | Dresses | 1400 | 560 |
3 | Provogue | Footwear | 1800 | 900 |
4 | Wrangler | Jeans | 2200 | 1760 |
5 | UCB | Shirts | 1500 | 1500 |
===========================================================
You will be given the above table (without discounted price) in
CSV form as standard input. This is the shop inventory.
You'll also get the customer options as comma separated Id's
after a newline. In the example below, 1,2,3,4 are the customer
choices.
Sample Input:
5 1, Arrow,Shirts,800
2, Vero Moda,Dresses,1400
3, Provogue,Footwear,1800
4, Wrangler,Jeans,2200
5, UCB,Shirts,1500
2 1,2,3,4
1,5
Expected output:
3860
2140
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all you need to let us know what have you done so far.  You should also provide some more input like what kind of application is it?  Is it a desktop based standalone application or it's a web application.
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In addition to the above, just a small suggestion, your data files appear to be csv format, so you should know about java file handling.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello any one got the solution for this
 
Marshal
Posts: 73766
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

We don't give out complete solutions to exercises.
 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic