Question: 1 . ( 4 points ) Create a Project called WhereAreMyFiles. Create a package called pak 1 . Create a Class called Difference. Write the

1.(4 points) Create a Project called WhereAreMyFiles. Create a package called pak1. Create a Class
called Difference. Write the Java program as follows.
public class Difference {
public static void main(String[] args){
// What is the difference?
System.out.print("(10.5+2*3)/(45-3.5)=");
System.out.print((10.5+2*3)/(45-3.5));
}
}
A. Locate the Difference.java file and Difference.class file. Copy&Paste the directory where the
files were located. (For example, C:\mexu\eclipse-workspace\WhereAreMyFiles\src)
Please refer to the tutorial on the next page if you dont know how to copy a directory.
(1) Directory for your Difference.java file:
(2) Directory for your Difference.class file:
B. What is the difference between these two files: Difference.java file and Difference.class file?
C. Run your program and look at the output. Explain the difference between the first print
statement and the second print statement.
2.(3 points) Write a program called Table and use only strings to display the following table.
Screenshot your console output. (The space between the columns is up to you)
a a^2 a^3
111
248
3927
3.(3 points) Write a Java program called MoreArithmetic using java.lang.Math classes that display the
following on the console. Use Math.PI and Math.pow(a, b) and do not manually type in the
numerical results for pi, pi *2, pi^2. Copy&Paste your source code and screenshot your console
output.
pi is 3.141592653589793
pi *2 is 6.283185307179586
pi^2 is 9.869604401089358

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!