Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help me fix this program, when I run it, I keep getting errors. Please Po

ID: 3584569 • Letter: P

Question

Please help me fix this program, when I run it, I keep getting errors. Please Post Fixed program.


import java.util.Scanner;
public class Child1
{public static void main(String [] args)
{
float a,b,c,d;
Scanner sc=new Scanner(System.in);
System.out.println("Please Enter the value of 1st number");
a= sc.nextFloat();
System.out.println("Please Enter the value of 2nd number");
b=sc.nextFloat();
System.out.println("Please Enter the value of 3rd number");
c=sc.nextFloat();
System.out.println("Please Enter the value of 4th number");
d=sc.nextFloat();
System.out.println("The Sum of 4 numbers is :"+(a+b+c+d));
System.out.println("The product of 4 numbers is :"+(a*b*c*d));
System.out.println("The product of sum of 1st 2 numbers and last 2numbers is :"+((a+b)*(c+d)));
}
}


Explanation / Answer

import java.util.Scanner;
public class Child1
{public static void main(String [] args)
{
float a,b,c,d;
Scanner sc=new Scanner(System.in);
System.out.println("Please Enter the value of 1st number");
a= sc.nextFloat();
System.out.println("Please Enter the value of 2nd number");
b=sc.nextFloat();
System.out.println("Please Enter the value of 3rd number");
c=sc.nextFloat();
System.out.println("Please Enter the value of 4th number");
d=sc.nextFloat();
System.out.println("The Sum of 4 numbers is :";

(a+b+c+d);
System.out.println("The product of 4 numbers is ";

(a*b*c*d);
System.out.println("The product of sum of 1st 2 numbers and last 2numbers is :";

((a+b)*(c+d));
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote