java a. Four integer variables have been declared and initialized: p1, p2, p3, and p4. You need to rotate the values so that the value currently in p1 moves to p2, the value currently in p2 moves to p3, etc. The value in p4 needs to move down and be saved in the p1 variable. Write the statement that completes the following code to make this happen: int temp = p4; p4 = p3; p3 = p2; p2 = p1; _______________   b. Write the Java data type you would use to hold values representing U.S. money that could be used in the following declaration and initialization: ______________ myBankBalance = 1234.56;

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

java

a. Four integer variables have been declared and initialized: p1, p2, p3, and p4. You need to rotate the values so that the value currently in p1 moves to p2, the value currently in p2 moves to p3, etc. The value in p4 needs to move down and be saved in the p1 variable. Write the statement that completes the following code to make this happen:

int temp = p4;
p4 = p3;
p3 = p2;
p2 = p1;
_______________

 

b.

Write the Java data type you would use to hold values representing U.S. money that could be used in the following declaration and initialization:

______________ myBankBalance = 1234.56;

 
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,