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
MrMuchimi
3 years ago
8

Write a program that lets a maker of chips and salsa keep track of their sales for five different types of salsa they produce: mi

ld, medium, sweet, hot, and zesty. It should use two parallel five-element arrays: an array of strings that holds the five salsa names and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using an initialization list at the time the name array is created. The program should prompt the user to enter the number of jars sold for each type. Once this sales data has been entered, the program should produce a report that displays sales for each salsa type, total sales, and the names of the highest selling and lowest selling products.
Computers and Technology
1 answer:
natali 33 [55]3 years ago
5 0

Answer:

Using C++ to solve the problem as given below

Explanation:

#include<iostream>

#include<string.h>

using namespace std;

int main()

{

string salsa_name[5]={"mild","medium","sweet","hot","zesty"};

int jar_sale[5]={0,0,0,0,0};

int i;

int total=0;

int high=0;

int high_index=0;

int low=0;

int low_index=0;

int temp=0;

for(i=0;i<5;i++)

{

while(temp<=0)

{

cout<<"enter the number of jars sold for "<<salsa_name[i]<<" ";

cin>>temp;

if(temp<=0)

cout<<"invalid data. please try again\n";

}

jar_sale[i]=temp;

temp=0;

}

cout<<"name\t jars sold\n";

cout<<"\n---------------------------\n";

for(i=0;i<5;i++)

{

cout<<" "<<salsa_name[i]<<"\t\t"<<jar_sale[i]<<"\n";

}

low=jar_sale[0];

for(i=0;i<5;i++)

{

total=total+jar_sale[i];

if(jar_sale[i] >= high)

{

high_index=i;

high=jar_sale[i];

}

if(jar_sale[i]<=low)

{

low_index=i;

low=jar_sale[i];

}

}

cout<<"\n total sale : "<<total;

cout<<"\n high seller : "<<salsa_name[high_index];

cout<<"\n low seller : "<<salsa_name[low_index];

}

You might be interested in
Write the importance of program in computer​
zysi [14]

Answer:

The reason that programming is so important is that it directs a computer to complete these commands over and over again, so people do not have to do the task repeatedly. Instead, the software can do it automatically and accurately.

Explanation:

5 0
3 years ago
A 2-dimensional 3x3 array of ints, has been created and assigned to tictactoe. Write an expression whose value is true if the el
ludmilkaskok [199]

Answer:

Following are the expression of the given statement.

tictactoe[0][0] == tictactoe[1][0] && tictactoe[1][0] == tictactoe[2][0]

Explanation:

In the following scenario, there is the two dimensional or matrix array of integer data type 'tictactoe' which has a total of nine elements then, after that we have to define the diagonal of the array variable which comprises the very 1st element of the 1st row are equal. So, the following expressions are true according to the scenario.

8 0
3 years ago
Listed items that are not in any particular order should be identified with
8090 [49]

Answer: a bulleted list

7 0
3 years ago
What's a good show to watch on Netflix?
AysviL [449]

Kengan Ashura and Umbrella Academy are two of my fav shows on Netflix

6 0
3 years ago
_____ refer(s) to computer programs that provide instructions for a computer to execute a desired task. Answer .a.Software .b. I
Dmitriy789 [7]
Software, which contains coded information that is almost like instructions for your computer.
8 0
3 years ago
Other questions:
  • Which osi layer is responsible for combining bits into bytes and bytes into frames?
    8·1 answer
  • Your network administrator finds a virus in the network software. Fortunately,
    13·1 answer
  • In an is framework, ________ is the bridge between the computer side on the left and the human side on the right
    12·1 answer
  • A senior center would like to add a new computer to their library so that members can check their email and read book reviews
    11·2 answers
  • The entirety of a packet at one layer becoming the payload section at another layer is known as
    8·2 answers
  • Many people in modern society have the notion that hard disks can be searched in an hour and files can be recovered from inciner
    10·1 answer
  • Special words are those words that start and end with the same letter. [14]
    12·1 answer
  • Collisions occur when one output is mapped to two inputs. <br><br> A. True <br> B. False
    7·2 answers
  • takes the perspective that a program describes what the solution to a problem is, not how that problem is solved. Select one: a.
    5·1 answer
  • Give an example of what Artificial Intelligence application most popular is used on a daily basis.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!