Third Software engineering work

Source: Internet
Author: User

(i) Demand analysis:

The design of the computer program compared to the last time to do the function of the increase, to set the countdown timer, in short, the design cost me a lot of time, demand I feel able to make elementary school students do some simple arithmetic problems, but the limitations are too large, this software has a lot of bugs, I have limited capacity, no way to change,

(b) Specific ideas:

I and the last calculator with different, this time I feel better than the last time, joined the timer I refer to the book of the timer, so that the user to customize the setting time of the function is to use a text box, run the time to enter the time you want to set, and for the time I also made a set, so that the user can not set a , and then press the start, the specific code teacher can btnstart code, calculator I was using the while do out, the basic idea is this. And the text box that entered the answer, I consulted the teacher. When you enter your answer, press ENTER to enter the next question automatically.

(c) Code implementation:

namespacecalculator{ Public Partial classForm1:form { Public  intCount =0;  Public  intright =0; Private intt = -;  PublicForm1 () {InitializeComponent (); }        Private voidForm1_Load (Objectsender, EventArgs e) {Combobox1.selectedindex=0; }        Private voidRandomnum () {Random ran=NewRandom (); intN1, N2; N1= ran. Next (1, One); N2= ran. Next (1, One); Txtnum1.text=N1.            ToString (); Txtnum2.text=n2.            ToString (); //if (Combobox1.text = = "-")            Switch(combobox1.text) { Case "-":                     while(true)                    {                        if(int. Parse (Txtnum1.text) >=int. Parse (Txtnum2.text)) { Break; } N1= ran. Next (1, One); N2= ran. Next (1, One); Txtnum1.text=N1.                        ToString (); Txtnum2.text=n2.                    ToString (); }                     Break;  Case "/":                     Break; } Txtresult.text=""; Count++; }               Private voidBtnstop_click (Objectsender, EventArgs e) {timer1. Enabled=false; Txtresult.enabled=false; MessageBox.Show ("the correct number of topics are:"+right+"the wrong topics are:"+ (count-right-1)); }        Private voidbtnStart_Click (Objectsender, EventArgs e) {                        Try{T=int.                Parse (Txttime.text); if(t<=0) {MessageBox.Show ("time cannot be a negative number"); return; } Label1. Text=t.tostring (); Txttime.enabled=false; }            Catch(Exception) {MessageBox.Show ("Please enter the correct time"); return; } txtresult.enabled=true; Timer1. Enabled=true; Timer1. Interval= +; Timer1.            Start ();        Randomnum (); }        Private voidTxtresult_keydown (Objectsender, KeyEventArgs e) {            intresult; if(E.keycode = =keys.enter) {Switch(combobox1.text) { Case "+": Result=int. Parse (Txtnum1.text) +int.                        Parse (Txtnum2.text);  Break;  Case "-": Result=int. Parse (Txtnum1.text)-int.                        Parse (Txtnum2.text);  Break;  Case "*": Result=int. Parse (txtnum1.text) *int.                        Parse (Txtnum2.text);  Break; default: Result=int. Parse (Txtnum1.text)/int.                        Parse (Txtnum2.text);  Break; }                if(Txtresult.text = =convert.tostring (Result)) { Right++;            } randomnum (); }        }        Private voidComboBox1_SelectedIndexChanged (Objectsender, EventArgs e) {        }        Private voidTimer1_Tick (Objectsender, EventArgs e) {            if(T <=0) {timer1. Enabled=false; Txtresult.enabled=false; MessageBox.Show ("Time to go! "); //txtresult.enabled = false;txtresult.enabled =false; Txttime.enabled=true; MessageBox.Show ("the correct number of topics are:"+ Right +"the wrong topics are:"+ (count-right-1)); } t= T-1; Label1. Text=t.tostring (); }           }}

(d) Screen:

(v) Testing

To tell the truth this test is still relatively satisfactory, because the basic implementation of the basic functions I want, and add the problem I added can let the result is not negative function, but also to allow users to customize the setting of the Countdown function,

(vi) PSP time-consuming analysis

(vii) Summary:

After doing this program, I feel a sense of accomplishment, but I know I am still a rookie, I will work hard, because my C # foundation did not learn, cause me a lot of things are not so easy, so I downloaded from the Internet some of you some of the basic C # Video of the podcast videos, I hope to be helpful, and, I had no idea what the program code was written, but now I can look at it almost, I believe it is progress. My pairing program was done with our dorm Yang Kun, and here are some of the pictures we were talking about.

The basic situation is this, with me for a long time, do not say, continue to transcription. Worry about everything. Really transcription really boring, have transcription of that period of time I feel like watching will I download video.

Third Software engineering work

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.