Group members: Li Guo, Chen Peng;
Design ideas:
Add a judgment statement on the basis of 2;
Package Suanfa;import Java.util.scanner;public class Suanfa {public static void main (string[] args) {//TODO auto-generate d method stub int i,j,number=0,time=0; --------------------------------------Customizable (Qty/ Printing method)--------------------------------------------------------------System.out.print ("Enter the number of topics you want to customize:"); Scanner in=new Scanner (System. in); int N=in.nextint (); -------------------------------------------range of Values---------------------------------------------------------------------- System.out.print ("Minimum value of the input range of values:"); Double Number1=in.nextint (); System.out.print ("Maximum value of the input range of values:"); Double Number2=in.nextint (); Double b[]= New Double[n]; Double C[]=new Double[n]; Double D[]=new Double[n]; -------------------------------------------whether there is a multiplication method------------------------------------------------------------------- System.out.print ("Whether there is multiplication law:--1; no--0:"); int Bool=in.nextint (); if (bool==1) {//-------------------------------------------Division has no number of------------------------------------------------------------------- System.out.print ("Whether the surplus number: is--1; no--0:"); int Bool1=in.nextint (); Char a[]={' + ', '-', ' * ', '/'}; for (i=0;i<n;i++) {time=i; b[i]= (int) (Math.random () * (number2-number1) +number1); c[i]= (int) (Math.random () * (number2-number1) +number1); j= (int) (Math.random () * (4-0) +0); if (c[i]==0&&a[j]== '/') {i=time-1; Continue } if (a[j]== ' + ') {d[i]=b[i]+c[i]; } if (a[j]== '-') {d[i]=b[i]-c[i]; } if (a[j]== ' * ') {d[i]=b[i]*c[i]; } if (a[j]== '/') {if (bool1==1) {if (b[i]%c[i]!=0) {D[i]=b[i]/c[i]; System.out.print ("Surplus number is" +b[i]%c[i]+ ":"); } else {i=time-1; Continue }} else {if (b[i]%c[i]==0) {d[i]=b[i]/c[i]; System.out.print ("No Number:"); } else {i=time-1; Continue }}}//-------------------------------------------subject to avoid duplication ()------------------------- ---------------------------------------------if (i==0) {if (b[0]==b[n-1]& &c[0]==c[n-1]&&d[0]==d[n-1]) {i=time-1; Continue }} else {if (b[i]==b[i-1]&&c[i]==c[i-1]&&d[i]==d[i-1]) {i=time-1; Continue }} System.out. println ("+b[i]+") "+a[j]+" ("+c[i]+") =___; "); --------------------------------------------The answer is correct------------------------------------------------------------- System.out.println ("Enter the answer you think is correct:"); int Daan=in.nextint (); if (Daan==d[i]) {System.out.println ("you answered correctly; the correct answer is:" +d[i] + ";"); number++; } else {System.out.println ("your answer is wrong; the correct answer is:" +d[i] + ";"); }} System.out.println ("You answered correctly:" +number + "problem;"); } else {char a[]={' + ', '-'}; for (i=0;i<n;i++) {b[i]= (int) (Math.random () * (number2-number1) +number1); c[i]= (int) (Math.random () * (number2-number1) +number1); j= (int) (Math.random () * (2-0) +0); if (c[i]==0&&a[j]== '/') {i=time-1; Continue } if (a[j]== ' + ') { D[i]=b[i]+c[i]; } if (a[j]== '-') {d[i]=b[i]-c[i]; }//-------------------------------------------topics to avoid duplication ()----------------------------------------------------- -----------------if (i==0) {if (b[0]==b[n-1]&&c[0]==c[n-1]&&d[ 0]==d[n-1]) {i=time-1; Continue }} else {if (b[i]==b[i-1]&&c[i]==c[i-1]&&d[i]==d[i-1]) {i=time-1; Continue }} System.out.println ("+b[i]+") "+a[j]+" ("+c[i]+") =___; "); --------------------------------------------The answer is correct------------------------------------------------------------- System.out.println ("Enter the answer you think is correct:"); int Daan=in.nextint (); if (Daan==d[i]) {SYSTEM.OUT.PRINTLN ("you answered correctly; the correct answer is:" +d[i] + ";"); number++; } else {System.out.println ("your answer is wrong; the correct answer is:" +d[i] + ";"); }} System.out.println ("You answered correctly:" +number + "problem;"); } }}
:
Weekly Activity Summary table:
|
Lectures |
Writing code |
Read the textbook |
Prepare for the exam |
|
|
Total Day |
Sunday |
|
|
|
|
|
|
|
Monday |
100 |
|
50 |
|
|
|
150 |
Tuesday |
|
30 |
|
|
|
|
30 |
Wednesday |
|
|
|
|
|
|
|
Thursday |
|
50 |
|
|
|
|
50 |
Friday |
|
|
40 |
|
|
|
40 |
Saturday |
|
120 |
|
|
|
|
120 |
Weekly totals |
100 |
200 |
90 |
|
|
|
390 |
Time log:
Date |
Start time |
End time |
Interrupt Time |
NET time |
Activities |
Note |
C |
U |
3/21 |
8:00 |
9:50 |
10 |
100 |
Lectures |
Theoretical hours, courseware |
|
|
|
15:00 |
16:10 |
20 |
50 |
Compiling programs |
|
|
|
3/22 |
15:10 |
15:40 |
|
40 |
Programming, Discussion |
|
|
|
3/24 |
17:20 |
18:10 |
|
50 |
Compiling programs |
|
|
|
3/25 |
21:00 |
22:00 |
20 |
40 |
Reading |
|
|
|
3/26 |
9:00 |
11:00 |
40 |
80 |
Compiling programs |
|
|
|
|
16:00 |
16:40 |
|
40 |
Write a report |
|
|
|
Bug Logging:
Date |
Number |
Type |
Introduction phase |
Exclusion phase |
Repair time |
Fixing defects |
3/26 |
2 |
20 |
Coding |
Compile |
20min |
|
Description: Error (Cause: Accumulated vertical misplaced position) when determining how many answers are accumulated Fewer operands are listed when executing cointine (redefining algebra to represent the current number of executions) |
Software Engineering Personal Work--3