Pair programming - Personal Project Analysis

Pair programming - Personal Project Analysis

 

One. Project requirements:

Primary and secondary school mathematics examination paper automatically generating program

Features:

1, the command line to enter a user name and password, separated by a space between the two (pre-program elementary, middle and high school three each account, specific see table), if a user name and password are correct, will be displayed according to the type of account. " the current selection is out of question XX ", XX for the elementary, middle and high school in one of the three options. Otherwise prompt "Please enter the correct user name and password", re-enter your user name and password;

2. Once logged in, the system prompts "XX ready to generate a math problem, enter the number of items is generated (input-1 will exit the current user, log in again):", XX for the elementary, middle and high school in one of the three options, user input the required number of test paper topic, the default will be the topic according to the account type. Operands each question is between 1-5, in the range of 1-100 operand;

3, number of questions valid input range is "10-30" (containing 10, 30, or -1 Log), compliance with the program title elementary, middle and high difficulty of generating the number of items in accordance with input of the roll (see appendix specific requirements table). A teacher in the same roll of the subject can not be repeated before the roll generated in the subject (to be specified folder present document shall prevail, see 5);

4, when logged in, if you need to switch the type of option, the command line, type "switch to XX", XX for the elementary, middle and high school in one of the three options, does not meet the entry requirements, procedures console prompt "Please enter elementary, junior high and high school in one of the three options "; enter the correct," "appears prompted for the number of items" ready to generate XX math topics, please enter the number of a task is generated ", enter the desired user out of the examination paper, the new system type setting is the topic;

5, generated task will be "year - month - day - when - minutes - seconds .txt" in the form of saving, a folder for each account. Each question with a question number, a blank line between each question;

Table-1: accounts, passwords

account type

Account

password

Remark

primary school

Joe Smith 1

123

 

John Doe 2

123

 

Joe Smith 3

123

 

junior high school

John Doe 1

123

 

John Doe 2

123

 

John Doe 3

123

 

Senior middle school

Wang Wu 1

123

 

Wang Wu 2

123

 

Wang v. 3

123

 

Table-2: elementary, middle and high school requirements of item difficulty

 

primary school

junior high school

Senior middle school

 

Difficulty requirements

+,-,*./

Square, square root

sin, cos, tan

 

Remark

There can be only +, -, * / and ()

Title least a square or square root operator

At least one title sin, cos or tan operator

 

 

two. Snippet advantages and disadvantages

 

advantage:

 

 

The code is used in object-oriented approach, many different codes by "written from scratch tail" idea is performed, and then create a user with respect to the class after a further description thereof contained in the object, compared to the previously mentioned the idea of ​​writing the code, this approach can be described in greater system of this mathematical papers account and process their papers generated in the future code updates and program maintenance, upgrades on its variable continuity and maintainability stronger.

 

 

 

       On the login process, the code clever use user.m_level to let the system decide what prompted word output at this time is to abandon the manual Points required three times the cumbersome code. In the case of the need for switching grade, which is generated using the subject, or the characteristics of the two strings are -1, whether classified as a 2 input string length.

 

 

 

If the first character is "cut", which corresponds to the jump function, determines whether the switching instruction is correct.

 

 

 

Topic randomly generated (primary school papers, for example)

In Java using the random function to automatically generate a random number, according to the remainder of dividing the random 4 & 100 to determine the range of their random number generated. And the numbers and symbols successively, flat pooled randomly, the question number and combination of equal numbers, a random variable generated title, empathy, Num cycle times, at the structure integration, is a set of topics num papers.

 

 

 

Built-in functions using java Date () to get the real-time creation of this document, and the form of minutes and seconds date when it was named the file name.

 

 

 

With all the topics before an account will be placed in a Hashset, so that the benefits that can be easily integrated in all the problems generated by this account, the next convenient for every subject, "whether the subject before a great extent heavy phase "determination.

 

 

 

Disadvantages: Title not achieved all grades random title brackets disposed left and right, resulting in a single sequence of operations.

 

Guess you like

Origin www.cnblogs.com/xjf66/p/11550314.html