Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 2 Pre - Lab You must bring the handwritten answers for the exercise to the lab with you. No late submission allowed. Completion of

Lab 2 Pre-Lab
You must bring the handwritten answers for the exercise to the lab with you. No late submission allowed.
Completion of the pre-lab is worth 15 points of the total 50 points for the lab.
Put the following statements in the right order to complete the java class resulting in the given output. You will need to provide the necessary curly braces and indenting. (Note: your name should be replaced with your actual name, your major should be replaced with your actual major) System.out.println("Welcome to IT 168!");
System.out.println("My major is your major. ln");
System.out.print("Let's have fun! ??
;
public class FirstClass
System.out.println("Java rules! ??
");
public static void main(String[] args)
System.out.print("My name is your name. ??
");
Expected Output
Welcome to IT 168!
My name is your name.
My major is your major.
Java rules!
Let's have fun!
Note: You will test this part in lab.
2. Consider the following program. Show what it will print on the screen.
public class Price
{
public static void main(String[] args)
{
double price;
price =18.99
System.out.print("The price is $");
System.out.println(price);
}
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions