repl.it
@AZRIELGIESWEIN/

Practice 6 Turn in for Davis For CS2 Reflection

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class Main {
  public static void main(String[] args) {
    //- = notes
    int w = (1);
    int l = (1);
    int t = (0);
    int a = (0);//-Max Area is 2500
    int b = (0);
    while(b<198 == true) {
    for( t= 2*(w+l); t<201;){
      for( w=1; w<100; w++){
        for( l=1; w+l<101; l++){
          a=(w*l);
          t=2*(w+l);
          if (a<2501){
            if (t<201){
              b = (b+1);
              //boolean b<198 = true;
              //while(b<198 == true) {
                System.out.println("Width:"+w);
                System.out.println("Length:"+l);
                System.out.println("Total Area:"+a);
                System.out.println("Total Bricks:"+t);
                System.out.println("");
                System.out.println("");
                System.out.println("Because System no wrk and java hate me:"+b);
              //}
          }
          else{
            System.out.println("Error");
            break;
          }
  //break;
          //for ( e = (w+l+e); e<9802;){//-To stop infinate loop
          
        //for(int t = (2*w+l); t<201;){
        //int t = (2*w+l);
        
            //System.out.println("Width:"+w);
            //System.out.println("Length:"+l);
            //System.out.println("Total Bricks:"+t);
            //System.out.println("");
          //back
          
        }
}
}
}/*
int bricks = 200;
for(int w=2;w<200;w+=2){
  int l = 200-w;
  System.out.println("real w:"+(w/2));
  System.out.println("real l:"+(l/2));
  System.out.println("area :"+((w*l)));
  System.out.println("perimiter :"+((w+l)));
}*/
  System.out.println("Highest possible area 2500");
}
}
}


//-              w>1 l>1 t<=200 t=2w+2l
?