Self-Learning Module

Outcomes Covered

Coding Standards

Introduction and Motivation [1:11]

The Rules [14:38]

Configuring CheckStyle in IntelliJ [7:05]

Activity

After installing Checkstyle, create a project with one Java source file called CodingStandard.java and copy the following code into it:

package weekfive;

import javax.swing.JOptionPane;
import java.util.concurrent.CyclicBarrier;

public class eunmest {
    public static void main(String[] manybois) {
       double Smooth,
     bRaIn,u,boI;Smooth=bRaIn=1;
        int STONKS =    18;
          u=1;
       boI = Smooth;
        do{u += Smooth / bRaIn;



        bRaIn*=boI++;
                 if(STONKS %23!=0)
    STONKS--;
    else
            break;
} while(true);
        System.out.println(u);}}

Before making any changes, read through the code and see if you can determine what it is doing. Then, fix all of the Checkstyle errors that are highlighted. Some of the variable names may need to be guessed at, but that is fine. Once it is "cleaned up," in a block comment at the end of the file, tell us what you think the code is supposed to do. If you are unsure, describe as best you can what the code is doing, even if you aren't sure why. Submit your CodingStandard.java file in Canvas.

Bonus Material (optional)

Thoughts on Comments

Tip Videos