Web-android Engineer first-5-1 programming exercises

Source: Internet
Author: User

Source: http://www.imooc.com/code/1554

Small partners, according to the knowledge, refer to the comments, the code Editor in the code to complement the complete, to achieve the score bonus function.

function Description: add points for the specified scores until the score is greater than or equal to 60, output the score before and after the addition score, and count the number of bonus points

Operating effect:

Task

warm tip : Try to do their own independent completion, Wood has the idea of the table is anxious. In the next 3 subsections, the @laurenyang will explain the analytical ideas of this section of the exercise, the optimized scheme, and how to assist with code development through the debugging capabilities of Eclipse

1  Public classHelloWorld {2      Public Static voidMain (string[] args) {3         4         //Variable Save score5         intScore = 53; 6         7         //variables are saved in addition to the number of times8         intCount = 0;9 Ten  One         //print output plus pre-score A            -         -          the         //as long as the score is less than 60, the loop performs the add-on operation and counts the number of points -          -          -          +          -          +          A          at         //print output plus score, plus number of points -        -  -  -  -     } in}

1  Public classHelloWorld {2      Public Static voidMain (string[] args) {3         4         //Variable Save score5         intScore = 53; 6         7         //variables are saved in addition to the number of times8         intCount = 0;9 Ten  One         //print output plus pre-score ASystem.out.println ("Pre-bonus score:" +score); -         -          the         //as long as the score is less than 60, the loop performs the add-on operation and counts the number of points -          for(; score + count <; count++) { -              -         } +          -          +          A          at         //print output plus score, plus number of points -System.out.println ("Bonus score:" + (score +count)); -System.out.println ("A total of" +count+ "Times!")); -  -  -     } in}

Web-android Engineer first-5-1 programming exercises

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.