i was wondering if someone is able to help me,
im kinda trying to make converter between 2 parameters which the user need to type,
and compare them ,same about the amount (the user needs to insert that parameter (the amount of the value))
im kinda getting confused how to write it right, i've made a start and not sure how to continue it, and i would gladly take any offers
suggestion about it :)

Thanks

Code java:

importjava.util.*;publicclass Converter
{static Scanner reader=new Scanner (System.in);publicstaticvoid main (String[]args){int amount=0, insertGold, insertCPs;double cpsPrice, goldPrice;System.out.println("What do you want to convert (cps silver)");int cp=reader.nextInt();int silver=reader.nextInt();if((silver==1)&&(cp==0))System.out.println("Type in the amount of the silver that u want to convert into cps");
insertGold=reader.nextInt();System.out.println("Type in the amount of the cps that u want to buy");
insertCPs=reader.nextInt();if((silver==0)&&(cp==1))System.out.println("Type in the amount of the cps that u want to convert into silver");
insertCPs=reader.nextInt();System.out.println("Type in the amount of the silver that u want to buy");
insertGold=reader.nextInt();}}

Yeah as you can see ima newbie :P
i was thinking maybe it's possible to make boolean access to those ifs...

November 17th, 2013, 03:20 PM

Norm

Re: Converter

Can you explain what the program is supposed to do? Also could give an example of the input to the program and what it is supposed to output with that input.

November 17th, 2013, 03:29 PM

xdevilx3

Re: Converter

technically it should work as a converter that the user inputs the parameters,
with the price, and amount of each side.

i kinda getting confused by my self right now....
that based idea is like you want to buy 10apples.
the price (the user need to input) x
output how many he can buy in that amount ,and will something be left. Something like that... .
hope it's enough to understand the idea that im trying to explain.

November 17th, 2013, 03:37 PM

Norm

Re: Converter

Can you give some specific examples of the input to the program and what it is supposed to output with that input

well something like that, it's for trading .... .i hope that the idea is now more understandable

November 18th, 2013, 06:52 AM

Norm

Re: Converter

Your example does not show:
Which data is the input
what is the output?

Can you make two lists? One of the input and one of the output.

November 18th, 2013, 07:28 AM

xdevilx3

Re: Converter

as i've said before the input includes Amount, buyPrice, and sellPrice, all the other things are the output such as profit, and ratio, right now im thinking of any other parameters ... .

November 18th, 2013, 07:35 AM

Norm

Re: Converter

Quote:

, right now im thinking of any other parameters ... .

That's good that you are trying to work on the details of the design before trying to write the code.

When you get a design and need help writing code for it, post the code and ask your questions about the problems you are having.

November 18th, 2013, 07:58 AM

xdevilx3

Re: Converter

Quote:

Originally Posted by Norm

That's good that you are trying to work on the details of the design before trying to write the code.

When you get a design and need help writing code for it, post the code and ask your questions about the problems you are having.

Thanks for the support... .
but i like to code the stuff i need , and just improve it, and by mistakes. but i came here because i'm lost and not sure how to continue that... i got the idea but im stuck...
i would appreciate it, if someone could help me to continue ...

November 18th, 2013, 08:22 AM

Norm

Re: Converter

Can you explain what you are stuck on?
So far you have said:
The input is: Amount, buyPrice, and sellPrice
what other things does the program need for input? Are there dependencies between the inputs?

What will the program's output be? Make a list.
How does the output depend on the input? Are there formulas?

November 18th, 2013, 08:36 AM

xdevilx3

Re: Converter

im stuck on the output of the programs, I'm not sure how to put things out so it will make the calculating stuff, how to make the percentage that i mentioned before. and something like boolean rule of:
Convert in or convert out as the code is written till now,and now as i wrote it.
about the in put, for now i can't think about anything.

output is gonna be different for both of sides, but it should be based on:
How much did the user spend:
How much the user won on that deal : (example)
Ratio of the gaining: (output) 110%
profit: 10% (10k)

basicly it should me like merchanting stats , if u know what i mean.

November 18th, 2013, 08:50 AM

Norm

Re: Converter

Sounds like you need to spend more time thinking about the problem.

November 18th, 2013, 09:10 AM

xdevilx3

Re: Converter

... i wonder why i came here now. for help or ... im thinking about it ,around 3days , and there is a reason i came here, if i could i wasn't coming here.

November 18th, 2013, 09:40 AM

Norm

Re: Converter

If you don't know specifically what you want the program to do, how can anyone help you write the program?