Search:

Type: Posts; User: Hazmat210

1. Thread: Confused without a teacher on a loop.

by Hazmat210
Replies
16
Views
654

[SOLVED] Re: Confused without a teacher on a loop.

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....
2. Thread: Confused without a teacher on a loop.

by Hazmat210
Replies
16
Views
654

[SOLVED] Re: Confused without a teacher on a loop.

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...
3. Thread: Confused without a teacher on a loop.

by Hazmat210
Replies
16
Views
654

[SOLVED] Re: Confused without a teacher on a loop.

So this is what it spit out after putting in that bit of code:
max=.4 after 501
4. Thread: Confused without a teacher on a loop.

by Hazmat210
Replies
16
Views
654

[SOLVED] Re: Confused without a teacher on a loop.

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...
5. Thread: Confused without a teacher on a loop.

by Hazmat210
Replies
16
Views
654

[SOLVED] Do {}while(balance4 >=1) loops once println of...

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...
6. Thread: Confused without a teacher on a loop.

by Hazmat210
Replies
16
Views
654

[SOLVED] In the infinite loop the balance4 displays the...

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...
7. Thread: Confused without a teacher on a loop.

by Hazmat210
Replies
16
Views
654

[SOLVED] I don't know how this is why I get confused. When...

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...
8. Thread: Confused without a teacher on a loop.

by Hazmat210
Replies
16
Views
654

[SOLVED] The balance 4 is initially zero then once the...

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...
9. Thread: Confused without a teacher on a loop.

by Hazmat210
Replies
16
Views
654

[SOLVED] Confused without a teacher on a loop.

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...
10. Thread: Arraylist of averages of two arrays list

by Hazmat210
Replies
11
Views
1,151

Re: Arraylist of averages of two arrays list

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.
...
11. Thread: Arraylist of averages of two arrays list

by Hazmat210
Replies
11
Views
1,151

Re: Arraylist of averages of two arrays list

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...
12. Thread: Arraylist of averages of two arrays list

by Hazmat210
Replies
11
Views
1,151

Re: Arraylist of averages of two arrays list

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++)
{...
13. Thread: Arraylist of averages of two arrays list

by Hazmat210
Replies
11
Views
1,151

Re: Arraylist of averages of two arrays list

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]);
}
14. Thread: Arraylist of averages of two arrays list

by Hazmat210
Replies
11
Views
1,151

Arraylist of averages of two arrays list

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

by Hazmat210
Replies
9
Views
757

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

by Hazmat210
Replies
9
Views
757

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.

by Hazmat210
Replies
9
Views
757

How do I do that? I thought that's what the break was for in the switch.

by Hazmat210
Replies
9
Views
757

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

by Hazmat210
Replies
9
Views
757

Thank you for the replies the program should go like this:

Display five options for a calculation
First integer
Second integer
if 5 is selected program terminates.
else...

by Hazmat210
Replies
9
Views
757

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...
21. Thread: Can someone help with my code and psuedocode.

by Hazmat210
Replies
4
Views
890

[SOLVED] Re: Can someone help with my code and psuedocode.

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...
22. Thread: Can someone help with my code and psuedocode.

by Hazmat210
Replies
4
Views
890

[SOLVED] Re: Can someone help with my code and psuedocode.

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.
23. Thread: Can someone help with my code and psuedocode.

by Hazmat210
Replies
4
Views
890

[SOLVED] Can someone help with my code and psuedocode.

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...
Results 1 to 23 of 24