Question: Integers lemonGrams 1 , lemonGrams 2 , lemonGrams 3 , and numAdults are read from input. Compute the average grams of lemons each adult receives

Integers lemonGrams1, lemonGrams2, lemonGrams3, and numAdults are read from input. Compute the average grams of lemons each adult receives using floating-point division, and assign the result to averageGrams.
Ex: If the input is 300194178,2, then the output is:
336.0
import java.util. Scanner;
public class SleepStatistics {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
int lemonGrams1;
int lemonGrams2;
int lemonGrams3;
int numAdults;
double averageGrams;
lemonGrams1= scnr. nextInt ();
lemonGrams2=scnr. nextInt();
lemonGrams 3=scnr. nextInt ();
numAdults = scnr . nextInt () ;
 Integers lemonGrams1, lemonGrams2, lemonGrams3, and numAdults are read from input. Compute

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!