Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Start BlueJ and create the project lab 0 2 under your cm 1 1 1 lab folder. Complete the programming exercises that follow. To automatically
Start BlueJ and create the project lab under your cmlab folder. Complete the programming exercises that follow.
To automatically clear the terminal when you execute you program, in the project window, click the View menu and select Show terminal or go to terminal window if open Click on the Options menu in the terminal window and click on "Clear screen at method call".
Programming Exercises.
Create a class called Test. Then type the following code into the class. Note: dont forget to delete the extra lines of code that were generated by BlueJ. Compile the program and execute it Notice the different output generated by each printf statement. This occurs because the equation in the first printf is quoted and treated as a String whereas the second printf equation is not quoted and thus executed before being printed.
public class Test
public static void main String args
System.out.printf is: ;
System.out.printffn;
Create a new class called DisplayJava in the same lab project Declare four String variables: line line line and line Initialize each String variable with text to produce the result below. Think about using a x grid to do the layout on paper first. The main method should display the following pattern in the terminal window.
Create a new class called Rectangle in the same lab project The main method should output your name, lab number, and the output of the calculation for the area of a rectangle and the perimter. Create the variables width, length, area, and perimeter of Type Double. Use the numbers for width and for length for initial valuses.
Remember the area of a rectangle is width length and the perimeter is width length.
Here is the expected output:
Name: Lab#:
The area of a rectangle with length and width is:
The perimeter of a rectangle with length and width is:
Upon completion of these exercises show the instructor then upload DisplayJava.java and Rectangle.java to DL
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started