20165118 experiment a familiarity with the Java development environment

Source: Internet
Author: User

Experiment with the familiarity of a Java development environment (Caesar password)

Lab report Cover
First, the experimental report cover
Course: Java Programming Class: 1651 class Name: Lee Paozhi No.: 20165118

Instructor: Lou Jia Peng Experiment Date: April 2, 2018

Experiment time: 13:45-15:25 Experiment serial number: experiment One

Lab name: Familiarity with the Java development environment
Second, the experiment title:, Caesar Password, and test (normal situation, abnormal situation, border situation)

Third, the contents of the experiment:
1. Compile and run a simple Java program using the JDK;

2. Use idea to edit, compile, run, and debug Java programs.
Experimental requirements:

3. Students who do not have a Linux base are advised to start with the Linux basics (new version) Vim Editor course;

4. Complete the experiment, write the experimental report, pay attention to the results of the experiment report, the problems encountered (tool search, installation, use, program editing, debugging, running, etc.), solutions (empty methods such as "Check the network", "Ask classmates", "reading" and so on all get 0 points) and analysis (from which can get what revelation What are the gains, lessons, etc);

5. Report the time of your PSP (Personal software Process).

6. Copying is strictly prohibited.

Four, experimental knowledge points:

1.JVM, JRE, JDK installation location and difference;

2. command line run JAVAC;JAVA;JAVAC-CP; JAVA-CP;

The setting method and application of 3.path,classpath,sourcepath;

4. Package management: package;import;javac-d;

5.Eclipse (Netbeans) manages Java projects, debugging: Breakpoints, single step execution, etc.;

6.Java basic syntax: type and type conversion; variables; operators; Process control, etc.;

Use of 7.JDK help documents

Experimental Process :

    • Creating Files and Packaging:

    • Code thinking and debugging: for legal characters to shift, illegal characters returned to the input interface, in addition to the A,z letter boundary judgment. Debugging process will suddenly prompt the registration code invalidation, and then went to the next 17 years of idea to solve, use when found that 17 years of idea incredibly without registration code. I don't know what's wrong. In addition, the Code section also refers to the information on the Internet.

Import Java.util.scanner;public class Kaisai {public static void main (string[] args) {Scanner sc = new Scanner        (system.in);        System.out.println ();        System.out.print ("Please select operation (1. Encrypt, 2. Decrypt):");        int index = Sc.nextint ();            if (1 = = index) {System.out.print ("Please enter the string to be encrypted:");            String str = Sc.next ();             StringBuffer newstr = new StringBuffer ();                for (int i = 0; i < str.length (); i++) {char c = str.charat (i);                        Switch (c) {case ' x ': Newstr.append (' a ');                    Break                        Case ' Y ': newstr.append (' B ');                    Break                        Case ' Z ': Newstr.append (' C ');                    Break Default:if (! (                            C >= ' A ' && C <= ' W ')) {newstr.append (c); CoNtinue;                        } Char Newchar = (char) (c + 3);                Newstr.append (Newchar);        }} System.out.println ("Encrypted string is:" + newstr.tostring ());            } else if (2 = = index) {System.out.print ("Enter the string to be decrypted:");            String str = Sc.next ();            char[] arr = Str.tochararray ();                        for (int i = 0; i < arr.length; i++) {switch (Arr[i]) {case ' a ':                        Arr[i] = ' x ';                    Break                        Case ' B ': arr[i] = ' Y ';                    Break                        Case ' C ': arr[i] = ' Z ';                    Break Default:if (! (                        Arr[i] >= ' d ' && arr[i] <= ' z ')) {continue;                } Arr[i]-= 3;          }            }  System.out.print ("Decrypted string is:");            for (int i = 0; i < arr.length; i++) {System.out.print (arr[i]);        }} else {System.out.println ("Sorry, please enter 1 or 2");    } sc.close ();   }}
    • Code to run:
Steps Time Consuming percentage
Demand analysis 10 8%
Design 20 15%
Code implementation 60 45%
Test 30 24%
Analysis Summary 10 8%

20165118 experiment a familiarity with the Java development environment

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.