1. From the point of view of file operation
First of all, you need to know what to do to make things easier and easier.
2 analysis from the perspective of structural programs and functions
First of all, to analyze the problem and then to determine the algorithm design and then encode the final test to determine whether it can be used, for example, the most basic printf case for scanf These functions of the use of programming statements end most basic is to add semicolons and so on, such as scanf data input: Format input function scanf scanf ("Format control string:. & input parameter 1,........& input parameter N);& is the address operator, and so on, the variables in this work have account cryptography number codes , and so on.
3 The role and application of the architecture body
4 If you design a product management system, how to design
First build a structure first in the mind there is a hierarchy of the management system such as the first interface if the account password and then what is next, such as what to retrieve the password file and so on, from the general point of view to meet the requirements of different groups
mportjava.awt.*;importjava.awt.event.*;p ublicclassdenglujiemianextendsframeimplementsactionlistener{ Labelusername=newlabel ("User name:");//Use text to create a user name tag Textfieldt1=newtextfield ();//Create a text box object Labelpassword=newlabel (" Password: ");//create a password tag textfieldt2=newtextfield (); Buttonb1=newbutton ("login");//Create Login button Buttonb2=newbutton ("Cancel");//Create Cancel button Publicdenglujiemian () {This.settitle (" Student Information Management System ");//Set the window caption this.setlayout (NULL),//Set window Layout manager username.setbounds (50,40,60,20);//Set the initial position of the name label This.add ( username);//Add the name label component to the container t1.setbounds (120,40,80,20);//Set the initial position of the text box This.add (t1);//Add the text box component to the container password.setbounds ( 50,100,60,20);//The initial position of the password label This.add (password);//Add the password label component to the container t2.setbounds (120,100,80,20);//Set the initial position of the password label This.add (T2 )///Add the password label component to the container b1.setbounds (50,150,60,20);//Set the initial position of the login button This.add (B1);//Add the Login button component to the container b2.setbounds (120,150,60,20) ;//Set the initial position of the Cancel button This.add (b2);//Add the Cancel button component to the container b1.addactionlistener (this);//Add Listener B2.addactionlistener (this) to the login button;// Adds listener this.setvisible (true) to the Cancel button,//sets the window's visibility this.setsize (300,200);//sets the size of the window Addwindowlistener (newwindowadapter () {publicvoidwindowclosing (windowevente) {system.exit (0);}}); /}publicvoidactionperformed (Actionevente) {if (E.getsource () ==B1)//processing the login event {Stringname=t1.gettext () through the inner class override method of closing the form; Stringpass=t2.gettext (); if (Name!=null&&pass.equals ("000123")//Judgment Statement {Newstudentjiemian ();}}} Publicstaticvoidmain (stringargs[])//main function {Newdenglujiemian ();}} The following method realizes the student interface design importjava.awt.*;importjava.awt.event.*;classstudentjiemianextendsframeimplementsactionlistener{ Menubarm=newmenubar ();//Create menu bar Menum1=newmenu ("info");//Create Menu "info" Menuitemm11=newmenuitem ("Insert");//create "insert" The menu item menuitemm12=newmenuitem ("Query"); Menum2=newmenu ("score");//Create Menu "score" Menuitemm21=newmenuitem ("Query");p Ublicstudentjiemian () {this.settitle ("Student Interface");// Set the window caption This.setlayout (Newcardlayout ());//Set the window Layout manager this.setmenubar (m);//Add the menu bar component to the container M.add (M1);//Place the Information menu into the menu bar M.add ( m2) m1.add (M11);//Add the Insert menu item to the Info menu M1.add (M12);//Add the Query menu item to the Info menu M2.add (M21);//Add the Query menu item to the "score" Menu M11.addactionlistener (this);//Add Listener M12.addactionlistener (this) to the "Insert" menu item,//Add listener M21.addactionlistener to the "Query" menu item ( This);//Add listener this.setvisible to the Query menu item (TRUE),//Set the window's visibility this.setsize (300,200);//Set the window's size Addwindowlistener ( Newwindowadapter () {publicvoidwindowclosing (windowevente) {system.exit (0);//Close Window}}); Publicvoidactionperformed (Actionevente) {if (E.getsource () ==M11)//processing "Add Information" event {newaddstudent ();} if (E.getsource () ==M12)//process "Query Information" event {newselectstudent ();} if (E.getsource () ==M21)//process "Query Score" event {newchengjistudent ();}} Publicstaticvoidmain (stringargs[]) {Newstudentjiemian ();//Create an object}
Advanced Language Program Impressions and works second lesson Liu Ziwei