Organizational Research By

Surprising Reserch Topic

energy drink consumption very confused using -'java'


energy drink consumption very confused  using -'java'

I understand the concept of the program itself as it is very simplistic. I am new to this language though and the book is not doing a very good job of explaining it to me. I am the type of person that learns by example. Here is the scenario:


  A soft drink company recently surveryed 12,467 of its customers and found that approximately 14 percent of those surveyed purchase one or more energy drinks per week. Of thos customers who purchase energy drinks, approximately 64 percent of them prefer citrus-flavored energy drinks. Write a Java program that displays the following:
  
¬†¬†‚ÄĘ ¬†The approximate number of customers in the survey who purchase one or more energy drinks per week.
  
¬†¬†‚ÄĘ ¬†The approximate number of customers in the survey who prefer citrus-flavored energy drinks.


The code that I have for the problem is listed below. I am begging for any help I can get here. What am I doing wrong?

/**
 * The Energy_Drink_Consumption class is used to determine the
 * approximate number of customers in the survey who purchase
 * one or more energy drinks per week. Of those customers
 * who purchase energy drinks, it also determines the approximate
 * number of customers who prefer citrus-flavored energy drinks
 * through a separate class.
 *
 * @author William Gambill
 * @version July 3, 2013
 */
public class Energy_Drink_Consumption
{
    private double customers;
    private double thoseThatPurch;
    private double preferCitrus;
    private double nopeople1;
    private double nopeople2;


public Energy_Drink_Consumption()
{
    customers = 0;
    thoseThatPurch = 0;
    preferCitrus = 0;
}

    /**
     *
     *
     *
     *
     */
    public void getInformation(double customers, double thoseThatPurch, double     preferCitrus)
    {
    }


    public void printOutput()
    {
        nopeople1 = customers * thoseThatPurch;
        nopeople2 = nopeople1 * preferCitrus;

        System.out.println("********************************************");
        System.out.println("ENERGY DRINK CONSUMPTION");
        System.out.println("********************************************");
        System.out.println("Number of people surveyed: " + customers);
        System.out.println("Number who purchase one or more energy drinks: " +  nopeople1);
        System.out.println("Number who prefer citrus flavored energy drinks: " + nopeople2);
        System.out.println();
    }


}

    
asked Sep 7, 2015 by rajesh
0 votes
66 views



Related Hot Questions



Government Jobs Opening


...