1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Umnica [9.8K]
3 years ago
15

A soft drink company recently surveyed 12,467 of its customers and found that approximately 14 percent of those surveyed purchas

e one or more energy drinks per week of those customers who purchase energy drinks, aaproximately 64 percent of them prefer citrus flavored energy drinks. write a program that display the following:
1. the approxiamte number of customers in the survey who purchase one or more energy drinks per week
2. the approximate number of customers in the survey who prefer citrus flavored enery drinks

Computers and Technology
1 answer:
Mnenie [13.5K]3 years ago
7 0

Given Information:

Total number of customers = 12,467

Customers who purchase one or more energy drinks per week = 14%

Customers who prefer citrus flavored energy drinks = 64% of customers who purchase one or more energy drinks per week

Required Information:

1. the approximate number of customers in the survey who purchase one or more energy drinks per week

2. the approximate number of customers in the survey who prefer citrus flavored energy drinks

Code with Explanation:

#include <iostream>

using namespace std;

int main()

{

   int customers = 12467;  // total no. of customers given

   int buy_drink;  // to store the number of customers who buy one or more energy drinks per week

   int citrus_drink;  // to store the number of customers who prefer citrus flavored energy drinks

 

   buy_drink = customers*0.14;  // multiply total number of customers with the % of customers who buy energy drinks

   citrus_drink = buy_drink*0.64;  // multiply no. of customers who buy one or more energy drinks per week with % of customers who prefer citrus flavor

// display the results calculated above

   cout<<"Total number of customers: "<<customers<<endl;

   cout<<"Number of customers who buy one or more drinks per week: "<<buy_drink<<endl;

   cout<<"Number of customers who prefer citrus flavored drinks per week: "<<citrus_drink<<endl;

   return 0;

}

Output:

Total number of customers: 12467

Number of customers who buy one or more drinks per week: 1745

Number of customers who prefer citrus flavored drinks per week: 1116

You might be interested in
The frequencies licensed by telecommunication firms to provide wireless service is known as _____.
Alexxandr [17]
<span>wireless spectrum. 
hope this will help you !

</span>
4 0
2 years ago
Sarah is working on a project in which she needs to record all the extracurricular activities in her college. Her college teache
saw5 [17]

If youre a plato user than the answer is A "create five sub-folders within the sports master folder"

Because there are five sport subjects.

5 0
3 years ago
Consider the following statements: #include #include class Temporary { private: string description; double first; double second;
Anna007 [38]

#include <iostream>  

#include <iomanip>  

using namespace std;  

class temporary  

{  

public:  

void set(string, double, double);  

void print();  

double manipulate ();  

void get (string&, double&, double&);  

void setDescription(string);  

void setFirst(double);  

void setSecond(double);  

string getDescription() const;  

double getFirst () const;  

double getSecond () const;  

temporary(string = "", double = 0.0, double = 0.0);  

private:  

string description;  

double first;  

double second;  

};  

void temporary::set(string a, double dblA, double dblB)  

{  

description = a;  

first = dblA;  

second = dblB;  

}  

void temporary::print()  

{  

cout << "\nDescription: " << left << setw(20) << description << endl <<  

" first: " << fixed << setw(10) << setprecision(2) << first << endl <<  

" second: " << fixed << setw(10) << setprecision(2) << second << endl;  

}  

double temporary::manipulate()  

{  

return first / 3.0 + second / 4.0;  

}  

void temporary::get(string& strDesc, double& dblFirst, double& dblSecond)  

{  

strDesc = description;  

dblFirst = first;  

dblSecond = second;  

}  

temporary::temporary(string d, double a, double b) : description(d), first(a), second(b) {}  

void temporary::setFirst(double dblFirst){first = dblFirst;}  

void temporary::setSecond(double dblSecond){second = dblSecond;}  

void temporary::setDescription(string desc){description = desc;}  

string temporary::getDescription() const {return description;}  

double temporary::getFirst () const{return first;}  

double temporary::getSecond () const {return second;}  

int main()  

{  

cout << "temporary a;";  

temporary a;  

a.print();  

cout << "a.setFirst(3.0): ";  

a.setFirst(3.0);  

a.print();  

cout << "a.setSecond(4.5): ";  

a.setSecond(4.5);  

a.print();  

cout << "a.setDescription(\"Picture Frame\") ";  

a.setDescription("Picture Frame");  

a.print();  

cout << "a.print(): ";  

a.print();  

return 0;  

}

6 0
3 years ago
python Write a program that will take a file named Celsius.dat that contains a list of temperatures in Celsius (one per line), a
jekas [21]

with open('celcius.dat', 'r') as fIn, open('fahrenheit.dat', 'w') as fOut:

   for line in fIn:

       fahrenheit = 9.0 / 5.0 * float(line) + 32

       fOut.write("%.1f\n" % fahrenheit)


You can control the number of decimals in the formatting clause in the write statement.

6 0
3 years ago
The scheme function (mult2-diff Ist) should take one argument, a list of numbers, and results in multiplying each number in the
JulijaS [17]

Answer:

The solution code is written in Python.

  1. def mult2_diff(lst):
  2.    num_list = []
  3.    for x in lst:
  4.        num_list.append(x * 2)
  5.    diff = num_list[0]
  6.    for i in range(1, len(num_list)):
  7.        diff = diff - num_list[i]
  8.    
  9.    print(diff)

Explanation:

Firstly, based on the requirement stated in the question, define a function <em>mult2_diff() </em>that takes one argument, <em>lst</em>, which is a list of numbers (Line 1).

This function is expected to multiply each number in the list by two and then followed with computing the difference. To do so, let's try to attempt the first function task, multiplying numbers.  Create a new list, num_list, to hold the multiplied numbers (Line 2). Use a for loop to traverse through each number in the input list, <em>lst</em>, and multiply each of them by two and add it to the <em>num_list </em>(Line 4-5).

To attempt the second function task, create another variable, <em>diff</em>, to hold the value of calculated difference between the numbers in the <em>num_list</em>. Initialize <em>diff </em>with the first number in the <em>num_list</em>. Use a another for-loop to traverse through each number in the num_list starting with second index, <em>1</em>, and calculate the difference between the <em>diff </em>and the current number extracted from the <em>num_list </em>through indexing.

At last print the output of <em>diff</em> (Line 11).

6 0
3 years ago
Other questions:
  • What is the penalty for refusing to submit to alcohol testing (drivers ed)
    7·2 answers
  • Oxygen-18 has an atomic number of 8. How many neutrons are in this isotope?
    7·1 answer
  • a one-two paragraph summary on the Running Queries and Reports tutorials. Apply critical thinking and an academic writing style
    6·1 answer
  • For selection purposes, it is critical that application items have a proven relationship between a selection device and some rel
    5·1 answer
  • A forensics workstation consisting of a laptop computer with almost as many bays and peripherals as a stationary workstation is
    10·1 answer
  • Given the availability of an ofstream object named output, write the other statements necessary to write the string "3.14159" in
    8·1 answer
  • Give the Division Hashing function and the index it maps the key 2000 into, assuming a primary storage area array size of 61 ele
    6·1 answer
  • How can i change my age on my profile here bc i am 13 but i accidenlty put 2005 instead of 2006 no need to rush to answer just w
    9·2 answers
  • Please help thank u!!!!!
    13·2 answers
  • I want to start a debate about something
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!