Based on everything that I've learned from this thread, i have come to a working solution:
package randomExperiments;
import java.util.Scanner;
import java.util.Random;
public class RandomExperiments {
public static void main(String[] args){
String strGuess = "";
int intGuess;
String password = "Megaman X";
Scanner input = new Scanner(System.in);
do{
System.out.println("We're still trapped in the do. Guess the password to get out!");
strGuess = input.nextLine();
}while(!strGuess.equals(password));
System.out.println("We have guessed correctly for strGuess.");
System.out.println("We will now start guessing for intGuess in the next do while loop.");
int magicNumber = 40;
do{
System.out.println("We're still trapped in the do. Guess the magic number to get out!");
intGuess = input.nextInt();
}while(intGuess != magicNumber);
System.out.println("We have guessed correctly for intGuess.");
}
}
I want to thank jim and norm to start incrementing my thanks counter, but I don't know how. So, thanks for your help in this thread