Packagetest;ImportJava.util.Scanner;/*function: Enter a number and show this number, less than 60, enter the loop, add 3 points per loop, and define a variable record added several times * * @author HYF **/ Public classJiafen { Public Static voidMain (string[] args) {Scanner input=NewScanner (system.in);//Create ScannerSystem.out.print ("Please enter your score:"); intScore=input.nextint ();//get the input score and save it in a variable intcount=0;//the number of cracksSystem.out.println ("Pre-bonus score is" +score); while(score<60) {score+=3;//add 3 points per cyclecount++;//Number of statistics} System.out.println ("The score after the bonus points is" +score); System.out.println ("A total of" +count+ "times.); }}
Debug shortcut key F6 (debugging here for the time being not explained in detail)
Java Foundation Development example for the first project (plus sub-project) written by a beginner