Answered step by step
Verified Expert Solution
Link Copied!

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

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

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

What does the * symbol represent in a SQL command?

Answered: 1 week ago

Question

Choosing Your Topic Researching the Topic

Answered: 1 week ago

Question

The Power of Public Speaking Clarifying the

Answered: 1 week ago