Basically main (currently the only method) is doing too much stuff (ie. it should not be handling all the nitty-gritty details). So your task is to move some of that functionality into two new methods for main to call.
Cleaned it up for you:
import java.util.*;
import java.text.*;
public class Loops
{
public static void main(String[] args)
{
Scanner numscan = new Scanner(System.in);
Random rand = new Random();
int x = rand.nextInt(20) + 1;
System.out.println("The computer has picked a number from 1 to 20, try and guess it.");
int guess = 0;
int total = 1;
while (guess != x)
{
System.out.print("Enter your guess: ");
guess = numscan.nextInt();
if (guess > x)
{
System.out.println("Your guess was high");
total = total + 1;
}
else if (guess < x)
{
System.out.println("Your gues was low");
total = total + 1;
}
else
{
System.out.println("Congratulations, you guessed it in " + total + " tries!");
}
}
System.out.println();
}
}
Are the motherboard standoffs installed properly? Are you using the appropriate screws to screw the motherboard into the standoffs?
If it's working fine out of the case with all components installed, it sounds like a short, and standoffs are the first thing you should check, double check, and triple check. Make sure you don't have extra standoffs installed, only the ones that match up with the hole pattern in your motherboard. Ensure there isn't any foreign material and that the I/O shield is installed in the correct orientation and seated firmly into position.
Also when installing your mobo, take care not to bend any of the I/O shield tabs the wrong way and check that none of them have wound up inside a port instead of around it.
I am absolutely sure that this change will NOT reduce the number of threads popping up in the main section related to support questions.
QFT
With Hardware and the main section there to collect all the "How's My Build?" flotsam, it was trivial to find interesting topics in the Software section.
In general, you should not use 'x' to represent multiplication. It will easily be confused for a variable. In digital mediums, just stick with *. It's the de facto standard.
0
This is such an unwieldy mess, it must be a nightmare to work on. Use Java, C#, or Python, your brain will thank you.
0
Sell your house and move closer to the server.
You're welcome.
0
Basically main (currently the only method) is doing too much stuff (ie. it should not be handling all the nitty-gritty details). So your task is to move some of that functionality into two new methods for main to call.
Cleaned it up for you:
0
If it's working fine out of the case with all components installed, it sounds like a short, and standoffs are the first thing you should check, double check, and triple check. Make sure you don't have extra standoffs installed, only the ones that match up with the hole pattern in your motherboard. Ensure there isn't any foreign material and that the I/O shield is installed in the correct orientation and seated firmly into position.
Also when installing your mobo, take care not to bend any of the I/O shield tabs the wrong way and check that none of them have wound up inside a port instead of around it.
0
Solid advice.The Head First books are excellent.
3
Browsers don't have ads, web pages do.
0
Orient a single magnet above the ground, such that it levitates or propels itself away from the Earth.
Good thing none of your data is stored magnetically...
0
QFT
With Hardware and the main section there to collect all the "How's My Build?" flotsam, it was trivial to find interesting topics in the Software section.
0
0
0
Of course it does, "banana" and "weird".
0
0
Which do you no good in the case that your house burns down.
0
Oh you can get much higher than that. With fiber, you can hit 1Gb/s.
0
What? No, there is nothing wrong with the monitors and there is no "break-in" period. This isn't a hardware problem at all.