Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-2008, 02:07 AM
Member
 
Join Date: Jun 2008
Posts: 7
Rep Power: 0
saeedsubedar is on a distinguished road
Default [SOLVED] Code review
Hello,

Can someone kindly review my code? I submitted it for a job and I was refused further stages of the inerview process:

PROBLEM: SALES TAXES

Basic sales tax is applicable at a rate of 10% on all goods, except books,
food, and medical products that are exempt. Import duty is an additional
sales tax applicable on all imported goods at a rate of 5%, with no
exemptions.

When I purchase items I receive a receipt which lists the name of all the
items and their price (including tax), finishing with the total cost of the
items, and the total amounts of sales taxes paid. The rounding rules for
sales tax are that for a tax rate of n%, a shelf price of p contains
(np/100 rounded up to the nearest 0.05) amount of sales tax.

Write an application that prints out the receipt details for these shopping
baskets...
INPUT:

Input 1:
1 book at 12.49
1 music CD at 14.99
1 chocolate bar at 0.85

Input 2:
1 imported box of chocolates at 10.00
1 imported bottle of perfume at 47.50

Input 3:
1 imported bottle of perfume at 27.99
1 bottle of perfume at 18.99
1 packet of headache pills at 9.75
1 box of imported chocolates at 11.25

OUTPUT

Output 1:
1 book : 12.49
1 music CD: 16.49
1 chocolate bar: 0.85
Sales Taxes: 1.50
Total: 29.83

Output 2:
1 imported box of chocolates: 10.50
1 imported bottle of perfume: 54.65
Sales Taxes: 7.65
Total: 65.15

Output 3:
1 imported bottle of perfume: 32.19
1 bottle of perfume: 20.89
1 packet of headache pills: 9.75
1 imported box of chocolates: 11.85
Sales Taxes: 6.70
Total: 74.68
==========

Solution:

Kindly go to my live.com url:

cid-cc696801510e9ec5.skydrive.live.com/browse.aspx/Public/java

All files in the folder are part of the solution. You can remove / modify the package line for your conveniance.

Thank you very much.

Saeed

P.S: Please let me know of any questions.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 06-15-2008, 02:33 AM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 6,463
Rep Power: 8
Fubarable is on a distinguished road
Default
good luck with this.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-17-2008, 12:06 AM
Member
 
Join Date: Jun 2008
Posts: 7
Rep Power: 0
saeedsubedar is on a distinguished road
Default Code review
I already have a solution at my url location. If anybody can review it and let me know how it looks, and if not to the mark, then why?!!

Thanks.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 06-17-2008, 07:19 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Last night I just go through your code roughly. Seems to me, just printing some values to the console, and no any major functionality you have workout. Is that right? If so, on what you are looking reviews.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 06-19-2008, 03:41 AM
Member
 
Join Date: Jun 2008
Posts: 7
Rep Power: 0
saeedsubedar is on a distinguished road
Default Code review
In general the whole code.

According to the problem, I need to print out the sales register output according to that shown in the problem. My code does that accurately but unfortunately the code did not receive a favourable response from the job I applied for.

Thanks,
Saeed
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 06-19-2008, 08:47 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
So there may have something not really valued by your customer. Fix it and let them know, if they allowed.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 06-20-2008, 04:36 AM
Member
 
Join Date: Jun 2008
Posts: 7
Rep Power: 0
saeedsubedar is on a distinguished road
Default Code review
The consulting company I applied to did not give an explanation about anything specific in the code but decided against pursuing further stages of the interview process. They said it is based on the code I had submitted.

Did you see something standout in the code that is not upto the standards, especially in the SalesRegister class?

Thanks for your help.

Saeed.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 06-20-2008, 04:53 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
I don't see such things really in your code. But may be they expect something on it. Bad thing I believe is, if they not given any specific details on the project, how they say it's not in standard at all.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 06-20-2008, 04:58 AM
Zosden's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 386
Rep Power: 2
Zosden is on a distinguished road
Default
maybe they gave the job to someone who wrote better code plus did they say to do it in java.
__________________
My IP address is 127.0.0.1
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 06-21-2008, 02:41 AM
Member
 
Join Date: Jun 2008
Posts: 7
Rep Power: 0
saeedsubedar is on a distinguished road
Default Code review
Thank you so much guys.

They wanted this to be done either in Java or C#.

Besides, this is not a single vacancy. They are a consulting company that hires constantly. It's perplexing to me.

They have a policy not to provide any detail as to the reason for not approving the code but they did let me know the decision was based on the code. Thus they did not say it was not up to the standards.

I got delayed by one day as my laptop broke down and I had to get a new one. I got the permission from them. ..Maybe they did not believe me.

Anyways it feels re-assuring to know that the code is alright.

Thanks again guys. Back to knowledge-seeking in Java.
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 06-23-2008, 04:50 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Seems this is quite strange to me. Without knowing let them what expect from your code directly, seeking something. Different people use there own standard in Java(not only Java actually), other than that I can't see anything going bad in your code.

__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #12 (permalink)  
Old 06-24-2008, 04:54 AM
Member
 
Join Date: Jun 2008
Posts: 7
Rep Power: 0
saeedsubedar is on a distinguished road
Default Code review
Thanks. I am still looking for a job though globally. Let me know if you know of any.
Bookmark Post in Technorati
Reply With Quote
  #13 (permalink)  
Old 06-24-2008, 05:13 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
What you mean here. I not clear what you expecting with this thread. If you looking a job related to Java, we have separate sub-forums for it.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #14 (permalink)  
Old 06-25-2008, 03:40 AM
Member
 
Join Date: Jun 2008
Posts: 7
Rep Power: 0
saeedsubedar is on a distinguished road
Default
I get it..it's the Jobs Wanted forum right?? I am sorry I'll do that there.

Thanks.
Bookmark Post in Technorati
Reply With Quote
  #15 (permalink)  
Old 06-25-2008, 06:25 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Your welcome. If you solve the problem please mark it as solved from the Thread Tools menu. Good luck.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help fixing my code.. or non code? MrHuggykins New To Java 1 03-19-2008 11:12 PM
Java Review toad New To Java 5 12-08-2007 02:28 AM
Java Review Question toad New To Java 1 10-29-2007 07:13 AM
tic tac toe code zoe New To Java 1 07-23-2007 05:36 PM
Generating Code Automatically Using Custom code Template In Eclipse JavaForums Eclipse 1 04-26-2007 04:52 PM


All times are GMT +2. The time now is 07:52 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org