Java Fundamentals (fifth post-course assignments) 04

Source: Internet
Author: User

1  PackageCom.xunhuan;2 3 ImportJava.util.Scanner;4 5  Public classZUOYE04 {6 7      Public Static voidMain (string[] args) {8         9Scanner meng00 =NewScanner (system.in);Ten             intnum=0;//defining an int variable OneString day= "";//defining the day variable A              -                 //Do ... wuhile cycle -              Do{ theSystem.out.println ("Please enter a number of 0-7:");//input -num =meng00.nextint (); -                 //If Judgment -                 if(num>7| | Num<0) { +SYSTEM.OUT.PRINTLN ("Wrong input!");//input is greater than 7 or less than 0 input error -                     Break; +}Else if(num==0){ ASystem.out.println ("End");//Input 0 End at                      Break; -                      -}Else{ -                         //If judge otherwise else -                 Switch(num) { -                      Case1:  inDay= "Today is Mon"; -  to                          Break; +                      Case2:  -Day= "Today is Tue"; the                         *                          Break; $                      Case3: Panax NotoginsengDay= "Today is Wed"; -                         the                          Break; +                      Case4:  ADay= "Today is Thu"; the                         +                          Break; -                      Case5:  $Day= "Today is Fri"; $                          Break; -                      Case6:  -Day= "Today is the SAT"; the                          Break; -                      Case7: WuyiDay= "Today is Sun"; the                          Break; -                  Wu                 } - System.out.println (day); About                 } $                  -} while(num!=0);//not equal to 0 -  -      A     } +  the}

Java Fundamentals (fifth post-course assignments) 04

Related Article

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.