Position: Home page » Bitcoin » BTC plastic surgery

BTC plastic surgery

Publish: 2021-04-24 01:10:59
1. Java curriculum design report
Title: calculator
College (Department): XXX college
grade major: XXX class
Student Name: XXX
Instructor: XX teacher
start time: 200X XX
finish time: 200X XX
contents
1. Abstract
2. Outline design
3. Detailed design
4. Test analysis
5 This calculator can carry out four simple operations (addition, subtraction, multiplication and division), but it is only limited to the decimal system. It can also carry out mutual conversion between (octal, decimal, hexadecimal). Octal can input up to 19 digits, decimal can input up to 18 digits, hexadecimal can input up to 14 digits, Backspace means backspace, clear means initialization, and you can run (jsp2003. Bat) directly under the window. The interface is gray and symmetrical
2. Outline design
(1) user defined class description_ number_ too_ Big *
* function: custom exception class, used to handle overflow of calculation results *
* inherited parent class: exception class *
* implemented interface: no *
class this_ number_ too_ Big extensions exception
{
} / / a custom result overflow exception class
* * * * * *
* class name: jsp2003 *
* function: main class*
* inherited parent class: frame class *
* implemented interfaces: itemlistener class, actionlistener class *
class jsp2003 extends frame implements itemlistener, actionlistener
{
public int number = 0, length = 18
/ / number is used to record the number of numbers entered,
/ / length is used to set the maximum number of digits allowed to be entered in different decimal systems, and the default is decimal public char mark = & 39; n';
/ / set the operation symbol to no, that is' n ', and its value is' +' - '*' / '
public double data = 0
/ / set the operation data to zero
public char ch
/ / used to temporarily store the first character of the pressed button
public Boolean refresh = false<
/ / set whether lab should refresh when inputting data, and the initial value is No.
main method description:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_ number_ too_ Big / / specifies that method should throw an exception
{if (Mark = = & # 39; n') // There is no operator
{mark = ch; / /, Then set the operator to the character you just entered,
data = double. Parsedouble (lab. gettext())// Then set the value of lab as
refresh = true// Then set the next input to refresh lab
}
else / / if the continuous operation is used (i.e. the '=' sign is not used), run the following statement
{switch (mark) / / calculate the result according to the operator, and save the result to data
{case & # 39+&# 39;: data+=Double.parseDouble(lab.getText()); break;< br />case '-&# 39;: data-=Double.parseDouble(lab.getText()); break;< br />case '*&# 39;: data*=Double.parseDouble(lab.getText()); break;< br />case '/&# 39;: data/=Double.parseDouble(lab.getText()); break;} < br />lab.setText(Double.toString(data)); // Display the operation result
mark = ch// Set the operator to the operator just pressed
refresh = true// Set the next input to refresh lab
number = lab. gettext(). Length()// Set the number of input characters
/ / system. Out. Println (lab. gettext())// The
if (Data & gt; Double.MAX_ Value)
/ / if data exceeds the maximum value of double type, a custom exception class will be thrown
{throw new this}_ number_ too_ big(); }<
}
} / / end js() method
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; 0"); number=0; Refresh=false;} < br />if(lab.getText().charAt(0)==' 0'&& Lab.gettext(). Length() = = 1)
/ / if the content of lab is 0, the content of lab will be replaced by the input character,
/ / otherwise, the input character
{lab.settext (character. ToString (CH)) will be added directly after the content of lab; number++;}< br />else
if(number< length)
{number++; lab.setText(lab.getText()+ch);}
} / / end enter() method
--- convert octal or hexadecimal to decimal I
public string goto_ 10 (string s, long l)
/ / parameter s: the string to be converted. Due to the control of input, the validity of the string is guaranteed
/ / parameter L: use to set whether to convert 8-ary or 16-ary to 10-ary, and its valid value is 8 or 16< br />{ String str=s; // The string used for conversion
long J = L// It represents the base system
long LG = 0, Jing = 1// LG is used to record the weighted multiplication sum, Jing is used to record the bit weight
char cha// Temporarily record the characters to be converted
for (int i = 1; i<= str.length(); i++)
{ cha=str.charAt(str.length()-i); < br />switch(cha)
{ case ' 1': lg=lg+1*jing; break;< br />case ' 2': lg=lg+2*jing; break;< br />case ' 3': lg=lg+3*jing; break;< br />case ' 4': lg=lg+4*jing; break;< br />case ' 5': lg=lg+5*jing; break;< br />case ' 6': lg=lg+6*jing; break;< br />case ' 7': lg=lg+7*jing; break;< br />case ' 8': lg=lg+8*jing; break;< br />case ' 9': lg=lg+9*jing; break;< br />case ' A': lg=lg+10*jing; break;< br />case ' B': lg=lg+11*jing; break;< br />case ' C': lg=lg+12*jing; break;< br />case ' D': lg=lg+13*jing; break;< br />case ' E': lg=lg+14*jing; break;< br />case ' F': lg=lg+15*jing; break;}< br />jing*=j; // The bit weight is upgraded to one level to prepare for the next use
}
return long.tostring (LG)< br />}//end String goto_ 10 () method
}
(2) program flow chart

3. Detailed design
Import Java. AWT< br />import java.awt.event.*;< br />class This_ number_ too_ Big extensions exception
{} / / a custom result overflow exception class
class jsp2003 extensions frame implements itemlistener, actionlistener {
public jsp2003() {
addwindowlistener (New windowadapter() {
public void windowclosing (windowevent E) {
dispose()< br />System.exit(0);< br />}
});< br />}
static Jsp2003 mainFrame = new Jsp2003();< br />static Label lab=new Label(" 0");< br />static Panel pnl1=new Panel(new GridLayout(4,3,3,3));< br />static Panel pnl2=new Panel(new GridLayout(4,1,3,3));< br />static Panel pnl3=new Panel(new GridLayout(1,2,3,3));< br />static Panel pnl4=new Panel(new GridLayout(6,1,3,3));< br />static Button bt9=new Button(" 9"); < br />static Button bt8=new Button(" 8");< br />static Button bt7=new Button(" 7");< br />static Button bt6=new Button(" 6");< br />static Button bt5=new Button(" 5");< br />static Button bt4=new Button(" 4");< br />static Button bt3=new Button(" 3");< br />static Button bt2=new Button(" 2");< br />static Button bt1=new Button(" 1");< br />static Button bt0=new Button(" 0");< br />static Button btdot=new Button(".& quot;); < br />static Button btequ=new Button("=& quot;); < br />static Button btadd=new Button("+& quot;);< br />static Button btsub=new Button("-& quot;);< br />static Button btmul=new Button("*& quot;);< br />static Button btdev=new Button("/& quot;);< br />static Button btA=new Button(" A");< br />static Button btB=new Button(" B");< br />static Button btC=new Button(" C");< br />static Button btD=new Button(" D");< br />static Button btE=new Button(" E");< br />static Button btF=new Button(" F");< br />static Checkbox ckb8=new Checkbox(" Octal & quot;)< br />static Checkbox ckb10=new Checkbox(" Decimal & quot;)< br />static Checkbox ckb16=new Checkbox(" Hexadecimal & quot;)< br />static Button btc=new Button(" clear");< br />static Button btt=new Button(" backspace");< br />public int number=0,length=18;
/ / number is used to record the number of numbers entered, and length is used to set the maximum number of digits allowed to be entered in different decimal systems. The default is decimal system
public char mark = & 39; n'; // If the operation symbol is set to none, it is n, and its value is' + '-' * '/'
public double data = 0// Set the operation data to zero
public char ch// The first character used to temporarily store the pressed button
public Boolean refresh = false// Set whether the lab needs to refresh when inputting data. The initial value is no
public static void main (string args) {
system. Out. Println (& quot; Starting Jsp2003...");< br />lab.setAlignment(Label.RIGHT);< br />lab.setBackground(Color.lightGray);< br />lab.setForeground(Color.BLUE);< br />lab.setFont(new Font(" Serief", Font.BOLD,18));< br />lab.setBounds(14,33,216,40);< br />mainFrame.add(lab);< br />CheckboxGroup grp=new CheckboxGroup();< br />ckb8.setCheckboxGroup(grp);< br />ckb10.setCheckboxGroup(grp);< br />ckb16.setCheckboxGroup(grp);< br />ckb8.setBounds(14,75,55,25);< br />ckb10.setBounds(69,75,55,25);< br />ckb16.setBounds(124,75,65,25);< br />ckb8.setState(false);< br />ckb10.setState(true);< br />ckb16.setState(false);< br />mainFrame.add(ckb8);< br />mainFrame.add(ckb10);< br />mainFrame.add(ckb16);< br />pnl1.setBounds(14,140,120,150);< br />pnl2.setBounds(144,140,40,150);< br />pnl3.setBounds(14,100,170,36);< br />pnl4.setBounds(190,100,40,190);< br />pnl1.add(bt7); < br />pnl1.add(bt8);< br />pnl1.add(bt9);< br />pnl1.add(bt4);< br />pnl1.add(bt5);< br />pnl1.add(bt6);< br />pnl1.add(bt1);< br />pnl1.add(bt2);< br />pnl1.add(bt3);< br />pnl1.add(bt0);< br />pnl1.add(btdot);< br />pnl1.add(btequ);< br />pnl2.add(btadd);< br />pnl2.add(btsub);< br />pnl2.add(btmul);< br />pnl2.add(btdev);< br />pnl3.add(btt);< br />pnl3.add(btc);< br />pnl4.add(btA);< br />pnl4.add(btB);< br />pnl4.add(btC);< br />pnl4.add(btD);< br />pnl4.add(btE); < br />pnl4.add(btF);< br />btA.enable(false);< br />btB.enable(false);< br />btC.enable(false)< br />btD.enable(false);< br />btE.enable(false);< br />btF.enable(false);< br />mainFrame.add(pnl1);< br />mainFrame.add(pnl2);< br />mainFrame
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750