Question

The four double variables dA, dB, dC, and dD alrea Help plz
0 0
Add a comment Improve this question Transcribed image text
Answer #1

import java.util.Scanner;
public class HelloWorld{

public static void main(String []args){
Scanner s=new Scanner(System.in);
System.out.println("Enter dA :");
double dA=s.nextDouble();
System.out.println("Enter dB :");
double dB=s.nextDouble();
System.out.println("Enter dC :");
double dC=s.nextDouble();
System.out.println("Enter dD :");
double dD=s.nextDouble();
double dMax=0;
if(dA>dB&&dA>dC&&dA>dD)
dMax=dA;
else if(dB>dA&&dB>dC&&dB>dD)
dMax=dB;
else if(dC>dA&&dC>dB&&dC>dD)
dMax=dC;
else
dMax=dD;
System.out.println("dMax : "+dMax);
}
}

Add a comment
Know the answer?
Add Answer to:
Help plz The four double variables dA, dB, dC, and dD already contain given values. Write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Need help writing four short recursive programs: Write a program called Permutations.java that takes an integer...

    Need help writing four short recursive programs: Write a program called Permutations.java that takes an integer command-line argument, n, and enumerates all permutations of the first n letters in the English alphabet. Be sure to handle exceptions of the types: i) bad user input (i.e., double, string), ii) n > 26 or n < 0. Write a program called PermutationsK.java that takes two integers, n and k, as command-line arguments and prints out all P(n,k) permutations that contain exactly k...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT