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
laila [671]
3 years ago
12

Walmart store wants to compare the sales of five of its stores. Write a complete program to ask the user to enter the sales for

5 stores. Create a bar chart displaying stars representing the sale amount for the day. must follow the requirements main method calls the print method. a for loop is required print method accepts an integer as its parameter representing the sale for the day. display stars based on the sale. one star represents $100 sale. a for loop is required Sample output:

Computers and Technology
1 answer:
marysya [2.9K]3 years ago
8 0

Answer:

Here is the C++ program.

#include <iostream>  //to use input output functions

using namespace std;   //to identify objects cin cout

   void print(int sales){   //method that accepts integer as its parameter representing the sale for the day

          for(int i=0;i<(sales/100);i++){  //loop to create a bar chart

           cout<<"*";   }   }  //prints stars representing the sale amount for the day

   int main(){          

       int sales1;    // stores the sales of store 1

       int sales2;    // stores the sales of store 2

       int sales3;    // stores the sales of store 3

       int sales4;     // stores the sales of store 4

       int sales5;    // stores the sales for store  5    

       

       cout<<"Enter the sales for store 1: ";  //prompts user to enter sales for store 1

       cin >>sales1;  //reads the value of sales for store 1 and stores it in sales1

       print(sales1);  //calls print method to display start representing the sales amount for the day for store 1

       cout<<"\nEnter the sales for store 2: ";  //prompts user to enter sales for store 2

     cin >>sales2;  //reads the value of sales for store 2 and stores it in sales2

       print(sales2); //calls print method to display start representing the sales amount for the day for store 2

       cout<<"\nEnter the sales for store 3: ";  //prompts user to enter sales for store 3

     cin >>sales3;  //reads the value of sales for store 3 and stores it in sales3

       print(sales3);  //calls print method to display start representing the sales amount for the day for store 3

       cout<<"\nEnter the sales for store 4: ";  //prompts user to enter sales for store 4

     cin >>sales4;  //reads the value of sales for store 4 and stores it in sales4

       print(sales4);  //calls print method to display start representing the sales amount for the day for store 4

       cout<<"\nEnter the sales for store 5: ";  //prompts user to enter sales for store 5

     cin >>sales5;  //reads the value of sales for store 5 and stores it in sales5

       print(sales5);     } //calls print method to display start representing the sales amount for the day for store 5

Explanation:

The program is well explained in the comments attached with each line of the program. Lets say user enters 100 as sales for store 1. Then the for loop works as follows:

for(int i=0;i<(sales/100);i++)

At first iteration:

i = 0

i<(sales/100) is true because 0 is less than 100/100 = 1

so the program moves to the body of loop which has the statement:

cout<<"*"

This prints one asterisk one output screen. Next the loop breaks when i = 1. So this only prints one asterisk in output since one star represents $100 sale. The screenshot of the program along with its output is attached.

You might be interested in
Five computer used in hospital
Elden [556K]

Answer:

information system, data analysis in medicine , medical laboratory computing , computer assisted medical decision making

4 0
3 years ago
At the ________ level of an organization, functional managers focus on monitoring and controlling operational-level activities a
Anon25 [30]

Answer:

Tactical Level

Explanation:

Based on the information provided within the question it can be said that the level of the organization that is being mentioned is called the Tactical Level. In this level managers focus choosing the tactics depending on the information that they gather from everyday operational activities. This information is later sent to the higher levels of the organization.

7 0
3 years ago
Read 2 more answers
To create a DateTime object that represents a due date that's 90 days after the current date, you use the following code:
Helen [10]

If $due_date contains a DateTime object, $due_date_diff will contain  

c. a DateInterval object

Explanation:

  • The DateInterval class ¶  represents a date interval.
  • A date interval stores either a fixed amount of time (in years, months, days, hours etc) or a relative time string in the format that DateTime's constructor supports.
  • The diff method is just as easy to use, but provides an extra piece of information: total days. This is important because when using the DateTime object to find a difference, we have a source and destination date, and therefore we can reduce the units of time into larger denominations. However, having the total number of days in between is a valuable piece of information.
  • The PHP DateTime class has three methods that work with a DateInterval object:
  1. add
  2. sub
  3. diff

Properties

  • y  :Number of years.
  • m  :Number of months.
  • d  :Number of days.
  • h  :Number of hours.
  • i  :Number of minutes.
  • s  :Number of seconds.
4 0
3 years ago
A company's ____________ is the percentage of the total target market for the product that belongs to the company.
grigory [225]

a companys Market share is the percentage of the total target market for the product that belongs to the company

3 0
3 years ago
With simple segmentation, a process is divided into a number of segments that need not be of equal size. When a process is broug
hoa [83]

Answer:

The missing word is <em>backing store.</em>

Explanation:

A backing store is a device for secondary storage of data that typically has greater capacity than the primary store but is slower to access.

A process must be loaded into memory in order to execute.

If there is not enough memory available to keep all running processes in memory at the same time, then some processes who are not currently using the CPU may have their memory swapped out to a fast local disk called the backing store.

The backing store may be the Hard Disk Drive or a Universal Serial Bus Drive.  The backing store can sometimes be referred to as <em>virtual memory.</em>

This memory that appears to exist as main storage although most of it is supported by data held in secondary storage, transfer between the two being made automatically as required.

Cheers!

4 0
3 years ago
Other questions:
  • A school librarian has been asked to identify inappropriate Internet usage. Which students would most likely be reported to the
    5·2 answers
  • Freya realizes she does not have enough in her bank account to use the debit card. She decides to use a credit card instead. Whi
    7·2 answers
  • When employees are hired, they agree to only use cell phones during breaks. How would you classify this?
    13·2 answers
  • To place the caption at the top of the image, you will need to change the __________ in the
    5·2 answers
  • EDI stands for__________________ a) Electronic digital interface b) Electronic data interchange c) Enterprise data interface d)
    5·1 answer
  • An item such as a smart card is an example of the _______ form of authentication.
    10·1 answer
  • Your program Assignment Write a program that reads a sentence as input and converts each word to "Pig Latin". In one version of
    15·1 answer
  • In fnaf who´s spring trap in fnaf 3 and who are the five victim names that he murdered and lure them into the back room.
    10·2 answers
  • Type the numbers 1-50 and then type Computers and Technology twice type it once forward and once backwards.
    5·2 answers
  • The term for an operator that may not evaluate one of its subexpressions is
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!