|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

06-15-2008, 03:07 AM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 7
|
|
|
[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.
|
|

06-15-2008, 03:33 AM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Posts: 1,289
|
|
|
good luck with this.
|
|

06-17-2008, 01:06 AM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 7
|
|
|
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.
|
|

06-17-2008, 08:19 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-19-2008, 04:41 AM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 7
|
|
|
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
|
|

06-19-2008, 09:47 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-20-2008, 05:36 AM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 7
|
|
|
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.
|
|

06-20-2008, 05:53 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-20-2008, 05:58 AM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 386
|
|
|
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
|
|

06-21-2008, 03:41 AM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 7
|
|
|
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.
|
|

06-23-2008, 05:50 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-24-2008, 05:54 AM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 7
|
|
|
Code review
Thanks. I am still looking for a job though globally. Let me know if you know of any.
|
|

06-24-2008, 06:13 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-25-2008, 04:40 AM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 7
|
|
|
I get it..it's the Jobs Wanted forum right?? I am sorry I'll do that there.
Thanks.
|
|

06-25-2008, 07:25 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|