Thank you Norm for your help I finally figured it out I just had to take the public off of the total class and add it to the coin class java document. I've cleaned it up some and posting it below....
Type: Posts; User: Hazmat210
Thank you Norm for your help I finally figured it out I just had to take the public off of the total class and add it to the coin class java document. I've cleaned it up some and posting it below....
OK, so I ended up creating a new class to hold the value of the balance and to do the summation of the balance at the end of each round and also ended up changing up all doubles to int. So my new...
So this is what it spit out after putting in that bit of code:
max=.4 after 501
Will do as soon as soon as I get out of work @ 6 and post results thank you for your help I was thinking of creating a seperate object in the coin class to store value of each loop and use that in...
Do {}while(balance4 >=1) loops once println of balance4 .15
Do {}while(balance4 <=1) infinite loop each println showed a balance4 of less than .4
I know this problem lies with balance4 field and...
In the infinite loop the balance4 displays the rounds winnings so each round the max value of balance is .4 which should make it loop but it doesn't. I tried going back and changing all doubles to...
I don't know how this is why I get confused. When I run it the way the statement is now program loops once if I switch it it goes into infinite loop that is what leads me to believe that my problem...
The balance 4 is initially zero then once the loop has completed once it will equal at the most .4 depending on coins face after toss. My condition is wrong I want it to run until balance4 is equal...
OK, so here is the code I have so far. The Main class where I have the problem it is looping once the round is over and the balance is added from the winning tosses. I can't figure out the loop runs...
Ok so I got it all to work except for the formatting i've got some reading to do on formatting but input on how to make all nice and would be nice below is code so far everthing works as it should.
...
So this below would be enough ? I just thought that a new loop would be necessary in order to set all four values in the grade array. Does this loop set all four values for grade array or is it...
I see now setting the grades in the array before knowing the averages makes no sense so array should be empty, but should it be like this:
for(int i = 0; i < average.length; i++)
{...
So in the loop would be written something like this:
for(int i = 0; i < average.length; i++)
{
average[i] = (testOne[i] + testTwo[i]) / 2;
System.out.println(average[i]);
}
I have written the code below the third array is suppose to store the averages of test scores from the first two arrays that were entered, fourth array stores letter grade. My question is do I need...
So thank you to all who replied. Big thank you too Norm I guess I really need to sit down sketch out the logic and then write the code.
Here is the rewritten working code.
import...
Ok, so i need to include the menu inside the while statement I see I will post new code here as soon as I get a chance I really do appreciate the help.
How do I do that? I thought that's what the break was for in the switch.
I initially wrote the code without the if else statement and the loop was still infinite it just keep displaying the equation until I closed the program. But I can see how the if else statement makes...
Thank you for the replies the program should go like this:
Display five options for a calculation
Ask for selection
First integer
Second integer
if 5 is selected program terminates.
else...
I wrote the code below for class assignment was to create program that does a calculation based on unput from menu and would continue to loop until user inputed exit number. But when compiled instead...
Sorry, professor asked us to include it at the very begining of our code. I am also not sure if the bills needs to be in the inputs.
/*
* Program will prompt for monetary value and display...
Thanks for the reply so essentially the psuedocode should have the same amount of lines as the code? I am new to forums and do not know the rules here I will wrap the code as soon as I figure out how.
I am new to programing and am taking intro to Java this semester. First project is program that determines least amount of bills and coins of a given amount. It is very basic and also was told to...