this is the original code:
import java.util.Scanner;
public class GuessANumber_basic
{
public static final int TARGET = 37;
public static void main(String[] args)
{
int guess;
Scanner consoleIn = new Scanner(System.in);
System.out.print("Enter a number between 1 and 100: ");
guess = consoleIn.nextInt();
do{
System.out.print("Enter a number between 1 and 100: ");
guess = consoleIn.nextInt();
if(guess == TARGET)
System.out.println("Congratulations! You found it.");
else
System.out.println("Sorry you didnt get it");
}
while (guess != TARGET);
System.out.print("Congratulations! You found it. ");
}
}
this is the new code for the assignment that is modified
import java.util.Scanner;
import java.util.Random;
public class GuessANumber_1
{
public static void main(String[] args)
{
String name;
int guess;
int Target;
int count = 0;
{ Random number = new Random();
}
target = num.nextInt(100);
ScannerConselIn = new Scanner(System.in);
do {
System.out.print("Enter name");
guess = consoleIn.nextInt();
if (count == 6)
System.out.print(" The Target was");
if (guess > TARGET)
System.out.print("Your guess is too high\n");
else
if (guess < TARGET)
System.out.print("Your guess is too low\n");
while(guess != TARGET);
System.exit( 0 );
}
}
This is the code that i have started
the attachment is the questions that i am being asked to do to modify code so that it follows these steps, any help would be great