20135331 Literary Java Experiment

Source: Internet
Author: User

First experimental report of laboratory building

Beijing Institute of Electronic Technology (BESTI)

Real Inspection report

Course: Java Lab class: 1353 Name: Art No.: 20135331

Score: Instructor: Lou Jia Peng Experimental Date: 2015.4.14

Experiment level: Preview degree: Experiment time:

Instrument Group: 31 Compulsory/elective: Compulsory experiment serial number: 01

experiment name: program development                                                   

experimental purposes and requirements:   1. java program development                                                          

                   2. implementation eclipse java program development                                                  

Experimental instrument:

Name

Model

Number

Eclipse

1

Virtual machines

1

L Experimental Knowledge points

Installation location and difference of 1.JVM,JRE,JDK

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) Managing Java projects, commissioning: Power outages, stepping, etc.

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

Use of 7.JDK help documents

II) Java program development, debugging under Eclipse

Development: Enter Eclipse->file->new->java project-> on the command line to enter the project name, such as Hellojdb->finish (new project)

File->new->class (New Java Class)

Enter the package name ljp (lowercase, can be customized), class name HelloJDB (the first letter of the word capital), tick the Automatically generate main function option, click the Finish button

Enter the code and run the result

Three) exercise (through the command line and Eclipse two ways to achieve, their number after the two and the total number of questions and the results of the remainder of the result plus 1 is the number of their own to complete the title, Under Eclipse Practice debugging Program)

Small calculation: 20135321è21mod5=1è1+1=2

2. Implement the arithmetic and test.

In the first part of the experiment, we were exposed to scanner, a Java feature that could come in handy.

The code is as follows:

Import java.util.*;

public class Sizeyunsuan

{

public static void Main (string[] args)

{

Sizeyunsuan t=new Sizeyunsuan ();

T.js ();

}

Scanner Scan;

public void JS ()

{

while (true)

{

Scan=new Scanner (system.in);

System.out.print ("Please enter a value for the calculation:");

Double a=scan.nextdouble ();

System.out.print ("Please enter an operator:");

Char C=scan.next (). charAt (0);

System.out.print ("Please enter the calculated two values:");

Double b=scan.nextdouble ();

Double sum=0;

Switch (c)

{

Case ' + ':

Sum=a+b;

Break

Case '-':

Sum=a-b;

Break

Case ' * ':

Sum=a*b;

Break

Case '/':

sum=a/b;

Break

Default

System.out.println ("Please enter the correct operator!") ");

Break

}

SYSTEM.OUT.PRINTLN (sum);

}

}

}

Problems encountered in the experiment:

1 in the experiment is easier because all follow the teacher step by step

2 in experiment two to set breakpoint jump last output 50 It's not too much of a problem.

3 experiment three is relatively difficult because the Java implementation of the arithmetic code problems in the code design process needs the help of students

Four time Statistics

Steps

Take

Percentage

Demand analysis

10min

15%

Design

10min

15%

Code implementation

30min

45%

Test

3min

2%

Analysis Summary

15min

23%

20135331 Literary Java Experiment

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.