Question: 5 9 7 2 8 8 . 4 4 2 2 9 9 0 . q 3 zay 7 Jump to level 1 Compute: r

597288.4422990.q3zay7
Jump to level 1
Compute: r=|p|+|q|2
Ex: If the input is 3.01.0, then the output is:
r=2.0
import java.util.Scanner;
public class MathMethods {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
double p;
double q;
double r;
p = scnr.nextDouble();
q = scnr.nextDouble();
V* Your code goes here */
System.out.printf("r =%.1f
", r); // Outputs r with 1 decimal place
}
}
5 9 7 2 8 8 . 4 4 2 2 9 9 0 . q 3 zay 7 Jump to

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 Programming Questions!