Answered step by step
Verified Expert Solution
Question
1 Approved Answer
12.2: i and j Create a new Java file called IJ.java. In this assignment, we are going to write another program that uses a for
12.2: i and j
- Create a new Java file called IJ.java.
- In this assignment, we are going to write another program that uses a for loop.
- Within the loop, make the variable i go from -5.0 to 5.0, counting by 0.5
- Inside the body of the loop, set another variable j to be the current value of i raised to the fourth power.
- For output, you will need to display the current values of both i and j in a chart, as shown below.
- Note that above the values, you should print out i above the i column and j above the j column.
- Also, you should display the values to exactly one decimal point.
- You will need to use tab (how can you print a tab?), System.out.printf and the Math.pow(base,exp) method.
- When you are finished, upload your source code to Canvas.
Your Output Should Look Indentical to the Following:
i j -5.0 625.0 -4.5 410.1 -4.0 256.0 -3.5 150.1 -3.0 81.0 -2.5 39.1 -2.0 16.0 -1.5 5.1 -1.0 1.0 -0.5 0.1 0.0 0.0 0.5 0.1 1.0 1.0 1.5 5.1 2.0 16.0 2.5 39.1 3.0 81.0 3.5 150.1 4.0 256.0 4.5 410.1 5.0 625.0
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