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
Leokris [45]
3 years ago
6

Write a program that lets the Michigan Popcorn Company keep track of their sales for seven different types of popcorn they produ

ce: plain, butter, caramel, cheese, chocolate, turtle and zebra. It should use two parallel seven-element arrays: an array of strings that holds the seven popcorn names and an array of integers that holds the number of bags of popcorn sold during the past month for each popcorn flavor. The names should be stored using an initialization list at the time the flavors array is created. The program should prompt the user to enter the number of bags sold for each flavor. Once the popcorn data has been entered, the program should produce a report for each popcorn type, total sales, and the names of the highest selling and lowest selling products. Be sure to include comments throughout your code where appropriate. Complete the C++ code using Visual Studio or Xcode, compress (zip) and upload the entire project folder to the Blackboard assignment area by clicking on the Browse My Computer button or by dragging the file inside the Attach Files box g
Computers and Technology
1 answer:
valentina_108 [34]3 years ago
5 0

Answer:

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    // declare and initialize popcorn name array
  6.    string popcorn_name[7] = {"plain", "butter", "caramel", "cheese", "chocolate", "turtle", "zebra"};
  7.    // declare and initialize sales array with 7 elements
  8.    int sales[7];
  9.    
  10.    // A loop to prompt user to enter sales for each popcorn
  11.    for(int i=0; i < 7; i++){
  12.        cout<<"Enter number of sales for " + popcorn_name[i] + " :";
  13.        cin>>sales[i];
  14.    }
  15.    
  16.    // Find maximum sales
  17.    int max = sales[0];
  18.    int maxIndex = 0;
  19.    for(int j=1; j < 7; j++){
  20.        if(max < sales[j]){
  21.            max = sales[j];
  22.            maxIndex = j;
  23.        }
  24.    }
  25.    
  26.    // Find minimum sales
  27.    int min = sales[0];
  28.    int minIndex = 0;
  29.    for(int k=1; k < 7; k++){
  30.        if(min > sales[k]){
  31.            min = sales[k];
  32.            minIndex = k;
  33.        }
  34.    }
  35.    
  36.    // Print popcorn name and sales
  37.    for(int l=0; l < 7 ; l++){
  38.        cout<<popcorn_name[l]<<"\n";
  39.        cout<<"Sales: "<< sales[l]<<"\n\n";
  40.    }
  41.    
  42.    // Print popcorn name with maximum and minimum sales
  43.    cout<<"Highest selling: "<< popcorn_name[maxIndex]<<"\n";
  44.    cout<<"Lowest selling: "<<popcorn_name[minIndex]<<"\n";
  45.    return 0;
  46. }

Explanation:

Create two arrays to hold the list of popcorn name and their sales (Line 5-8). Next prompt user to input the sales for each popcorn (Line 10-14). Get the maximum sales of the popcorn (Line 17-24) and minimum sales (Line 27-34). Print the popcorn name and sales (Line 37-40) and the popcorn name with highest and lowest selling (Line 43-44).

You might be interested in
Write at least complete set of HTML code to hyperlink to “Home.html”..
faltersainse [42]

Answer:

HTML Link Colors

By default, a link will appear like this (in all browsers):

An unvisited link is underlined and blue

A visited link is underlined and purple

An active link is underlined and red

You can change the link state colors, by using CSS:

8 0
3 years ago
How many responses does a computer expect to receive when it broadcasts an ARP request?why?
Alla [95]

Answer: The response that is expected when it broadcast an ARP request is one or zero.

Explanation: ARP request means Address Resolution Protocol which is a protocol responsible for the mapping of the IP(Internet protocol)address of a system to the MAC(Media Access Control) layer. Only one response is received only if the IP address is present in the ARP otherwise if the IP address does not matches then no response is returned.Thus only one or zero response can be received when a ARP request is process.

5 0
3 years ago
What are the most common types of cables in a network?
Maru [420]

the most common are twisted pair, coaxial, Ethernet cross over, and fiber optic.

4 0
3 years ago
On the Format tab, in the Shape Styles group, there is the option to change the _____. a. Shape Effects b. Shape Fill c. Shape O
makvit [3.9K]
Hey there! Hello!

The answer to this problem will be D, "All Of The Above." I've attached a picture that shows the Shape Format tab in Microsoft Word. You can see in the dropdown that there's options for all three of your listed choices: Shape Fill, Shape Outline, and Shape Effects. 

I hope this helped you out! Feel free to ask me any additional questions if you have any. :-)

6 0
3 years ago
Which task is not possible with VLOOKUP?
Flauer [41]

Answer:c

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • A ____ is a collection of computers and users that are identified by a common security database. workgroup controller segment do
    7·1 answer
  • A smart phone is always a _____.<br> client<br> server<br> network<br> process
    10·1 answer
  • Displays are geared for a specific resolution. what is this resolution called?
    15·1 answer
  • You have been asked to report on the feasibility of installing an IP CCTV camera system at your organization. Detail the pros an
    5·1 answer
  • In java Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. Ex:
    7·1 answer
  • Write a program to create a customer bill for a company. The company sells only five products: TV, DVD player, Remote Controller
    12·1 answer
  • Write code using the range function to add up the series 99, 98, 97,...
    11·1 answer
  • Chose the term that matches each definition.
    15·1 answer
  • What is software?
    6·1 answer
  • I have the requirements for Ace rank on Brainly but hasn't given me it yet. Does it just take longer than normal ranks or someth
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!