"Object-oriented programming and data structures" sixth experiment report

School No. 2019-2020-1 "Object-oriented programming and data structures" sixth experiment report

Course: "Programming and Data Structures"
Class: 1823
Name: Zhang child is
Student ID: 20182304
experiments Teacher: Johnny
experiment Date: October 21, 2019
Compulsory / Elective: Compulsory

1. Experimental content

1. list practice required to achieve the following functions:
the keyboard to enter some integer, the establishment of a list;
these numbers is your student number in sequence out of double digits. Coupled with today's time.
For example, your student number is 20172301
Today time is 2018/10/1, 16:23:49 sec
figure is
20, 17,23,1, 20, 18,10,1,16,23,49
print all the elements of the list, the total number of elements and output.
In your program, please use a special variable name to record the total number of elements, the variable name is your name. For example, you called Zhang Third, then the variable name is
int nZhangSan = 0; // initialized to 0.
finish this step, your program checked into source control (git push).
2. list practice required to achieve the following functions:
to achieve node insert, delete, output operations;
continue you on a program to expand its functionality, each finished a new feature, or written more than 10 lines of new code, the code to check in , committed to the source server;
reading a file from disk, this file has two numbers.
Digital read from a file 1, bit 5 is inserted into the list, and the total number of digital printing, and elements. Keep this list, proceed to the next operation.
Digital read from the file 2 is inserted into the list of 0, and the total number of printed numbers, and elements. Keep this list, and proceed to the next operation.
Just delete numbers from the list and print the total number 1. All figures and elements.
3. Exercise list, required to achieve the following functions:
using bubble sort or selection sort list sorted according to the value of the size;
If your student number is singular, select bubble sort, selection sort or choose.
In each round of sorting, the total number of print elements, and all elements of the current list.
Continue to expand in the program (2) obtained with the same program file, write different functions to achieve this function. Still with nZhangSan (your name) to represent the total number of elements.
4. The realization of experiments (1) and (2) in the android
5. The experiment implemented android platform (3)

2. Experimental procedure and results

Here to fill in the experimental process and results

  • Experiment 1: A list of books on class completion, a test it is easy to complete.

  • Experiment 2: The problems for reading and writing identification document, the second experiment is also easy to accomplish on an experimental basis a set of
 File file = new File("C:\\Users\\666\\IdeaProjects\\dky-zzz-java", "Test62.txt");
        if (!file.exists()) {
            file.createNewFile();
        }
        Writer writer2 = new FileWriter(file);//直接用writer写
        writer2.write("122 2388 ");//调用写方法
        writer2.flush();

        String content = null, info = null;
        Reader reader2 = new FileReader(file);//读取
        BufferedReader bufferedReader = new BufferedReader(reader2);

        while ((content = bufferedReader.readLine()) != null) {//content内容不为空
            info = content;
        }
        System.out.println("info: " + info);
  • Experiment 3: My school number is double number, you need to write a Selection Sort
public void Choose() {
        int count = isEmpty();//读取链表元素数量
        temp = head.getNext();//temp在前,从大往小排列
        LinearNode<T> c;
        c = head.getNext();

        for (int i = 1; i <= count; i++) {

            for (int j = i + 1; j <= count; j++) {
                c = c.getNext();
                if (((int) c.getElement()) < ((int) temp.getElement())) {  
                     // 交换次序
                    T d;
                    d = c.getElement();
                    c.setElement(temp.getElement());
                    temp.setElement(d);
                }

            }
            temp = temp.getNext();
            c = temp;
        }
    }
  • Experiment 4: This experiment is that both the difficulty of an Android layout file, the design listener, but also that the write test Andrews

3. Experimental problems encountered in the process and settlement process

  • Question 1: XXXXXX
  • Problem 1 Solution: XXXXXX
  • Question 2: XXXXXX
  • Problem 2 Solution: XXXXXX
  • ...

Other (perception, thinking, etc.)

xxx
xxx

Reference material

Guess you like

Origin www.cnblogs.com/acgacg/p/11768270.html