Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

Absence of disparate impact

Answered: 1 week ago