Web-android Engineer first form nested if of -4-4 Java conditional statement

Source: Internet
Author: User

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

Nested IF statements determine the condition of the inner if if the condition of the outer if is true. For example, the schedule of activities, if today is a working day, then go to work, if today is the weekend, then go out to play, at the same time, if the weather is clear on weekends, the outdoor playground to play, otherwise go to the indoor playground.

Grammar:

Execution process:

For example:

Operation Result:

Task

Complete the code in the Code Editor to achieve the schedule: a final with a preliminary score of more than 80 points, followed by the gender division of the men's group finals and the Women's group finals.

The result of the operation is:

1  Public classHelloWorld {2      Public Static voidMain (string[] args) {3         intScore = 94;4String sex = "female";5         6         if(Score > 80) {7             if(Sex = "female") {8System.out.println ("Enter the women's team finals");9}Else if(Sex = "male") {TenSystem.out.println ("Enter the men's role"); One             } A}Else { -System.out.println ("Not in the finals");  -         } the     } -}

Web-android Engineer first form nested if of -4-4 Java conditional statement

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.