Java Foundation Development example for the first project (plus sub-project) written by a beginner

Source: Internet
Author: User

 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.