Well lets say someone enters 3,4, 5 as the sides, thats a right triangle . In the output i want it to say Side 1 is: 3..... Side 2: is 4..... Side 3: is 5....It is a right Traingle.....The area is...
Type: Posts; User: PCn3rd51
Well lets say someone enters 3,4, 5 as the sides, thats a right triangle . In the output i want it to say Side 1 is: 3..... Side 2: is 4..... Side 3: is 5....It is a right Traingle.....The area is...
I have this project due and its asking that i print out what type of triangle it is when the user inputs 3 sides. I have most of it done and working, but it pops up different windows instead of using...
SOLVED! Figured it out last night but it works perfectly. I want to thank all who helped me. Feel free to test it out for yourselves \:D/
import javax.swing.*;
public class Homework4a {
...
Disregard my last post, wasn't thinking straight lol....
for ( int arrayindex = 0 ; arrayindex < numarray.length ; arrayindex++ ) {
numarray[arrayindex] != userinput;
}
It seems a little redundant to nest 10 if statements to test that, is there an easier way of doing that?
if ( userinput != numarray[1] ) {
if userinput != numarray[2] ) {
if...
well i would be one of the 10 random numbers. so how would i phrase my if statement if i want the userinput to not equal one of those 10 numbers?
All of you have been a big help. I fixed it so that it is now generating 10 random numbers every time the while loop starts. My only problem now is that its saying that int i needs to be initialized....
the code compiles and runs, but im not sure if its populating all 10 allocated spots.
how can i test it to see if it does completely fill the array?
If the number is negative or over 100 it...
yea it should populate the 10 random numbers. and keep on asking the user to guess the number, the numbers shouldn't change
isnt the for loop and math.random assigning random numbers to those locations? or should i just have the math.random only in the for loop?
"i" would be the random number that gets inserted into the 10 index locations
I have to create a variable that holds the index location? I didn't know that, how can i go about doing that? and where would i declare that variable?? I appreciate your help. Just keep in mind this...
Hi all, just joined this forum and looking for a little advice with my code. My project was to create an array holding 10 integers and populate the array with 10 random numbers. Then ask the user to...