Question: for my java class, i'm able to get the program to ask for 1 integer and 1 floating point. I need to help to getting

for my java class, i'm able to get the program to ask for 1 integer and 1 floating point. I need to help to getting it to ask for a two integers and 2 floating point between a min and max. Then display the sum of the two integers and two floating points.for my java class, i'm able to get the program to ask

what i need the to be:for 1 integer and 1 floating point. I need to help to

4 import java .util. Scanner: 6 public class Summer 7 public static void main (String args) final double MINDOUBLE 1.0 10 11 final double MAX DOUBLE 20.0 12 final int MININT 10 13 final int MAXINT 20 14 15 Scanner in new Scanner System. in) 16 show the result of promptAndsum for doubles 17 System. out .printf The sum of your values is 4.2f prompt lin. MINDOUBLE, MANDOUBLE) 18 show the result of promptAndsum for ints 19 System. out printf ("The sum of your values is sd n", prompt (in MININT MAXINT) 20 21 22 prompt for an integer value 23 24 public static int prompt (Scanner in int min, int max) 25 final String STR PROMPT Please enter an integer between min and max 26 27 final String STR INVALID Invalid value, please try again. 28 int i min 1; 29 30 while (i k min. l i max) 31 32 33 System. out print (STR PROMPT); i in extInt 34 35 if (i main II i max) System. out.println (STR INVALID) 36 37 38 39 return. 40 41 prompt for a floating point value in the specified range 42 43 public static double prompt (Scanner in double min, double max) 44 min and max 45 final String STR PROMPT Please enter a floating point value between 46 final String STR INVALID Invalid value, please try again. 47 double d mln 1.0 48 49 while (d k min. l d max) 50 51 52 System. out print (STR PROMPT 53 in next Double 54 if (d main II d max) System. out.println (STR INVALID) 55 56 57 58 return d; 59 60

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