Software Engineering--third job

Source: Internet
Author: User

--Title:

Please write a " software "that can automatically generate primary arithmetic topics.

allow the program to accept the user to enter the answer, and determine the right and wrong.

Finally, give a total of / the wrong number.

--Demand Analysis:

This " software " is mainly for primary school students, considering the limited use and mastery of the computer, this " Software " the operation should be as simple as possible, easy to use;

users can then " Software " to practise simple arithmetic;

this " Software " can submit the user's answer, and judge the right and wrong;

When you use this " Software " give the correct and wrong number of questions in time.

--Functional Requirements:

First login user;

Secondly, select the calculated data;

Design a time timer;

Judge the answer to the wrong, give the answer;

The number of design calculations;

--Extended function:

The program can set the answer time, the time is set to an integer, in seconds, the maximum can not exceed 120 seconds, if the answer time is not answered, the prompt: Time has arrived, can not answer questions.

Users in the first answer, users need to enter the user name, the next time the user starts, the program needs to remember the user's previous input user name

--Design:

Through the use of VS2010 design, thinking, coding, the use of modular program of the idea of software development, the inside of the function encapsulated, to call;

--Code implementation:

usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespacewindowsformsapplication1{ Public Partial classForm1:form { PublicForm1 () {InitializeComponent (); }        Private voidDomainupdown1_selecteditemchanged (Objectsender, EventArgs e) {        }        ints =0; Private voidButton1_Click (Objectsender, EventArgs e)        {Jisuan (); }        Private voidLabel2_click (Objectsender, EventArgs e) {        }        Private voidForm1_Load (Objectsender, EventArgs e) {        }        Private voidButton2_Click (Objectsender, EventArgs e) {TextBox1.Text=""; TextBox2.Text=""; TextBox3.Text=""; Textbox4.text=""; Combobox1.text=""; Label6. Text=""; }        LongSecond = -; Private voidTimer1_Tick (Objectsender, EventArgs e) {Second-=1; Label12. Text=NewDateTime (Second *10000000).        Tolongtimestring (); }        Private voidButton3_Click (Objectsender, EventArgs e) {        }        Private voidButton3_click_1 (Objectsender, EventArgs e) {Label10. Text=Textbox5.text; }        voidJisuan () {if(TextBox1.Text = =NULL|| TextBox2.Text = =NULL|| TextBox3.Text = =NULL) {MessageBox.Show ("calculate the number and the answer you fill cannot be empty"); }            Else{s= S +1; Label6. Text=s.tostring (); intA, B; intC; A=Int32.Parse (TextBox1.Text); b=Int32.Parse (TextBox2.Text); if(Combobox1.text = ="Plus") {C= a + b; TextBox3.Text =c.tostring ();} if(Combobox1.text = ="minus") {C= A-B; TextBox3.Text =c.tostring ();} if(Combobox1.text = ="Multiply") {C= A * b; TextBox3.Text =c.tostring ();} if(Combobox1.text = ="except") {C= A/b; TextBox3.Text =c.tostring ();} if(TextBox3.Text = =textbox4.text) {label4. Text="Congratulations, calculate right!!!! "; }                Else{label4. Text ="Sorry, the answer is wrong!!! "; } }         }    }}

--Achieve effect:

--Design steps:

(1) Demand analysis

(2) Design Summary

(3) Modular analysis

(4) Code implementation

(5) Unit test

--psp

Software Engineering--third job

Related Article

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.