Results 1 to 15 of 15
  1. #1
    saeedsubedar is offline Member
    Join Date
    Jun 2008
    Posts
    7
    Rep Power
    0

    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.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    good luck with this.

  3. #3
    saeedsubedar is offline Member
    Join Date
    Jun 2008
    Posts
    7
    Rep Power
    0

    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.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    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. :)

  5. #5
    saeedsubedar is offline Member
    Join Date
    Jun 2008
    Posts
    7
    Rep Power
    0

    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

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    So there may have something not really valued by your customer. :) Fix it and let them know, if they allowed.

  7. #7
    saeedsubedar is offline Member
    Join Date
    Jun 2008
    Posts
    7
    Rep Power
    0

    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.

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    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.

  9. #9
    Zosden's Avatar
    Zosden is offline Senior Member
    Join Date
    Apr 2008
    Posts
    384
    Rep Power
    7

    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

  10. #10
    saeedsubedar is offline Member
    Join Date
    Jun 2008
    Posts
    7
    Rep Power
    0

    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.

  11. #11
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    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.


  12. #12
    saeedsubedar is offline Member
    Join Date
    Jun 2008
    Posts
    7
    Rep Power
    0

    Default Code review

    Thanks. I am still looking for a job though globally. Let me know if you know of any.

  13. #13
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    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.

  14. #14
    saeedsubedar is offline Member
    Join Date
    Jun 2008
    Posts
    7
    Rep Power
    0

    Default

    I get it..it's the Jobs Wanted forum right?? I am sorry I'll do that there.

    Thanks.

  15. #15
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. I need help fixing my code.. or non code?
    By MrHuggykins in forum New To Java
    Replies: 1
    Last Post: 03-19-2008, 10:12 PM
  2. Java Review
    By toad in forum New To Java
    Replies: 5
    Last Post: 12-08-2007, 01:28 AM
  3. Java Review Question
    By toad in forum New To Java
    Replies: 1
    Last Post: 10-29-2007, 06:13 AM
  4. tic tac toe code
    By zoe in forum New To Java
    Replies: 1
    Last Post: 07-23-2007, 04:36 PM
  5. Replies: 1
    Last Post: 04-26-2007, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •