20182326 2019-2020-1 "Data structures and object-oriented programming" Report of the second experiment

20182326 2019-2020-1 "Data structures and object-oriented programming" Report of the second experiment

Course: "Programming and Data Structures"
Class: 1823
Name: Liu Yingjie
Student ID: 20182326
experiments Teacher: Johnny
experiment Date: September 16, 2019
Compulsory / Elective: Compulsory

1. Experimental content

1) Simple preparation calculator, complete arithmetic modulo operation.
(2) requires two numbers input from the keyboard, using the decision statement to select an operation after the calculation result output, then it is determined to continue to select and calculate the loop or exit.
(3) write test code, test verification. ( Https://www.cnblogs.com/rocedu/p/4472842.html )

2. Experimental procedure and results

  • Write Calculator
    image
  • Write validation code
    image
  • Run the code
    image

    3. Experimental problems encountered in the process and settlement process

  • Question 1: has reached the end of the file when parsing
  • Problem 1 Solution: Code semicolon or less hit brackets
  • Question 2: Missing return statement
  • Problem 2 Solution: a calculator code is not written return
  • Question 3: may not have been initialized variable
  • Question 3 Solution: initialization value

Other (perception, thinking, etc.)

This is the first time I began to learn java to write more complex code, from which I learned a lot:

  1. Less likely to hit some places, such as semicolons, braces
  2. Reservations are not familiar with the word
  3. Java and C language has many similarities, sometimes common.

    Reference material

Guess you like

Origin www.cnblogs.com/20182326lyj/p/11543924.html