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

1. Research on the Internet to obtain an estimate of how often a person sneezes

ID: 3846067 • Letter: 1

Question

1. Research on the Internet to obtain an estimate of how often a person sneezes in a day.

import java.util.Scanner;

public class HealthData {

public static void main (String[] args) {
Scanner scnr = new Scanner(System.in);
int userAgeYears = 0;
int userAgeDays = 0;
  
/* FIXME: Declare the variables needed for this calculation */
  
System.out.println("Enter your age in years: ");
userAgeYears = scnr.nextInt();
  
userAgeDays = userAgeYears * 365;
  
/* FIXME: Calculate the number of sneezes in lifetime */

System.out.println("You are " + userAgeDays + " days old.");
  
/* FIXME: Print the result (end with a new line) */
  
return;
}

Explanation / Answer

Considering that a person generally sneezes 4 times a day(this is the max general value that i researched)

PROGRAM:-

import java.util.Scanner;

class HealthData {

public static void main (String[] args) {
Scanner scnr = new Scanner(System.in);
int userAgeYears = 0;
int userAgeDays = 0;
  
/* FIXME: Declare the variables needed for this calculation */
final int sneezeDay = 4; int sneezeLifetime;   

System.out.println("Enter your age in years: ");

userAgeYears = scnr.nextInt();
  
userAgeDays = userAgeYears * 365;
  
/* FIXME: Calculate the number of sneezes in lifetime */

sneezeLifetime = sneezeDay * userAgeDays;

System.out.println("You are " + userAgeDays + " days old.");
  
/* FIXME: Print the result (end with a new line) */
System.out.println("You have sneezed "+ sneezeLifetime+" times in your lifetime ! ");
return;
}
}