Link to home
Start Free TrialLog in
Avatar of ahmed911
ahmed911Flag for Saudi Arabia

asked on

how to make user input BOLD in java

Dears ,

im very new java programming trainer and i have a problem makin user input printed out in java (BOLD)  .here is the program now i need X to be printed out in bold.

// a program that allows the user to keep guessing a number until she gets it right.
import java.util.Scanner;
class guessNew
{
 public static void main(String[] args)
 { int predict=312;
   boolean num=false;
   Scanner in = new Scanner(System.in);
   System.out.print("guess my number its betweeen 1 and 1000. ");
   for(int i=1;(!num);i++)
   {
    int x=in.nextInt();
    if (predict<x)System.out.println("Your guess : " + x + " Too high! ");
        else if (predict>x)System.out.print("Your guess : " + x + " Too low! ");
             else {
                System.out.println("Correct! The number of guesses you had was: " + i);    
                num =true;
              }        
   }              
 }
}
SOLUTION
Avatar of basav_com
basav_com
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ahmed911

ASKER

thanks