Results 1 to 7 of 7
- 05-28-2013, 03:30 AM #1
Member
- Join Date
- May 2013
- Posts
- 43
- Rep Power
- 0
Totally new to java, going through some text book programming challenge. need help.
Attachment 5054
I am using jgraps and don't know how I have to start with this problem on my book. This is as far as I could do from what I learned from book. :(
It says
Last month Joe purchased some stock in Acme software, Inc. Here are the details of the purchase:
-the number of shares that Joe purchased was 1,000
-When Joe purchased stock, he paid $32.87 per share
-Joe paid his stockbroker a commission that amounted to 2% of the amount he paid for the stock.
Two weeks later Joe sold the stock. Here are the details of the sale:
-the number of shares that joe sold was 1,000
-He sold the stock for $33.92 per share.
-He paid his stockbroker another commission that amounted to 2% of the amount he received for the stock.
Write a program that displays the following information:
-the amount of money Joe paid for the stock.
-the amount of commission Joe paid his broker when he bought the stock.
-the amount that Joe sold the stock for.
-the amount of commission Joe paid his broker when he sold the stock.
-display the amount of profit that Joe made after selling his stock and paying the two commissions to his broker.
(if the amount of profit that your program displays is a negative number, then Joe lost money on the transaction.)
I read through books but it doesn't give me any similar examples and helps aren't available to me
coz no one I know around me know anything about java. there are bunch of other program challenge problems
I want to try but no matter how many times I read books, books doesn't explain much about how to write them
or have solution list. I am using starting out with java from control structures through objects 5th edition from Tony Gaddis.
Is there solution lists available somewhere online for this book's programming challenge? I can do all example problems
but like the math books, exercise problems are several steps harder than example problems and they don't explain
how to do it either. How do these book makers expect anyone new to book do these problems by their own unless
they have tutor or something? :(Last edited by shin777; 05-28-2013 at 04:59 AM.
- 05-28-2013, 04:03 AM #2
Re: Totally new to java, going through some text book programming challenge. need hel
As far as I can see this is a math problem and not that difficult to do in any programming language. All you need to do is declare a bunch of variables, do some calculations and assign the result to the variables. Then display results on screen. What specific problems are you having?
- 05-28-2013, 04:10 AM #3
Member
- Join Date
- May 2013
- Posts
- 43
- Rep Power
- 0
Re: Totally new to java, going through some text book programming challenge. need hel
thank you. can you show me some example or something? i can do math with my head but don't know how to write it in java. I am at ch.2 of book and it doesn't really show me how to do it or have examples. :(
I probably read it through 3 times by now.
- 05-28-2013, 04:39 AM #4
Re: Totally new to java, going through some text book programming challenge. need hel
Doing it in java is pretty much the same.
Java Code:int a = 5; int b = 10; int c = a * b; int d = b - a + 20; int e = b - (a + 20); //etc
- 05-28-2013, 05:00 AM #5
Member
- Join Date
- May 2013
- Posts
- 43
- Rep Power
- 0
Re: Totally new to java, going through some text book programming challenge. need hel
Ok. thank you. I rewrote it. Does it look ok now? :)
- 05-28-2013, 05:06 AM #6
Re: Totally new to java, going through some text book programming challenge. need hel
I don't know. Sorry to be harsh but it is not my job to make sure your code works, it is yours. Does it produce the correct result?
- 05-28-2013, 05:10 AM #7
Member
- Join Date
- May 2013
- Posts
- 43
- Rep Power
- 0
Similar Threads
-
Game programming : please help me understand this example from book
By EscSequenceAlpha in forum New To JavaReplies: 1Last Post: 07-14-2012, 11:57 AM -
programming challenge - calculator display
By weps in forum Advanced JavaReplies: 8Last Post: 09-16-2011, 10:47 PM -
java programming challenge Number 1
By tacosalad in forum New To JavaReplies: 5Last Post: 01-16-2008, 11:25 PM -
Programming an Address book
By d.anthonii in forum New To JavaReplies: 0Last Post: 12-31-2007, 06:26 PM -
Which book is good for 3D+2D game programming with java
By romina in forum Java 2DReplies: 1Last Post: 08-07-2007, 06:19 AM
Bookmarks