Java fourth post-class assignment 1

Source: Internet
Author: User

1. Design Ideas

1) Set the main method, introduce the package, 2) define the string, enter the string, 3) set a character variable, set the loop, make the character variable equal to the character in the string labeled I, according to the ASCII code set, output.

2. Flowchart

3. SOURCE program

  Import java.io.*;  public class Exercise {public      static void Main (string[] args) throws IOException {                  BufferedReader reader = new Bu Fferedreader (New InputStreamReader (system.in));//input         String str = reader.readline ();                  char Chararray;         for (int i =0;i<str.length (); i++)//output character         {            chararray= (char) (Str.charat (i));             if ((chararray>=65&&chararray<=87) | | | (chararray>=97&&chararray<=119))             {                 Chararray + = 3;             }             else             {                 Chararray = (char) (CharArray-23);             }             System.out.print (Chararray);         }     } }

4. Results

Java fourth post-class assignment 1

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.