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
SCORPION-xisa [38]
3 years ago
14

Write a program that allows you to enter grocery item names into an array of strings and the cost of each item in an array of do

ubles. At the beginning of the program prompt the user to enter the total number of items they will be entering. Max value of 100. After entering the item names and cost, the application should display the names and cost and total cost of all items.
Engineering
1 answer:
harina [27]3 years ago
5 0

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main(){

//declare arrays

string ItemName[100];

double ItemCost[100]={0.0};

//declare variable

string name="";

double Total=0.0;

int NumItems=0;

cout<<"Enter number of grocery item you will be entering";

cin>>NumItems

cout<<"\n";

if (NumItems>100)

{

  cout<<"Enter grocery items less than 100"

  cin>>NumItems

  cout<<"\n";

}

for (int i=1;i>=NumItems;i++)

{

  cout<<"Please enter the item name in one word only, Example:                                icecream\n";

  cin>>ItemName[i]

  cout<<"Please enter the cost as a decimal number, Example: 2.05\n\n";

  cin>>ItemCost[i];

}

cout<<"Items"<<"   "<<""$""<<"Cost"<<endl

for (int i=1;i>=NumItems;i++)

{

    cout<<ItemName[i]<<"   "<<"$"<<ItemCost[i]<<endl

}

for (int i=1;i>=NumItems;i++)

{

  Total=Total+ItemCost[i];

}

cout<<"Total:$"<<Total<<endl;

system("PAUSE");

return 0;

}

You might be interested in
A ___ is a type of purlin used as a horizontal stiffener between columns around the perimeter of a building.
BabaBlast [244]

Answer:

girt can be the answer u know

6 0
2 years ago
Which one of the following is a list of devices from least efficient to most efficient
Sergeu [11.5K]

Answer:

(A)-Light-Bulb, Automobile Engine, Power Plant, Electric Motor

Explanation:

To get the least efficient to the most efficient the chart below explains how to the get it

Incandescent light bulb-5%

Florescent light bulb-20%

Electric motor-90%

Power plant-35%

Automobile engine-25%

Home oil furnace-80%

4 0
3 years ago
Which of the following is NOT true concerning the color of minerals? A. Some minerals have a consistent color, but many have a r
mixer [17]

Answer:

Option D

A mineral’s color reflects the wavelengths of light that are absorbed by the mineral.

Explanation:

Color is one of the physical properties of minerals. Many minerals have a wide range of colors but there are some minerals with one consistent color and such minerals are referred as monochromatic minerals for example azurite. Normally, the streak color tends to be less variable than the color of the whole mineral and impurities or minor chemical components in a mineral react and often control the display color of resultant mineral. Option D is incorrect since mineral's color don't reflect wavelengths of light absorbed by such minerals.

5 0
3 years ago
Answer true or false 3.Individual people decide what will be produced in a command<br> oconomy
Pie

Answer:

False

Explanation:

The government decides the productions.

7 0
4 years ago
Read 2 more answers
g A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output
Nataly [62]

Answer:

# Program is written in Python Programming Language

# Comments are used for explanatory purpose

# Program starts here

# Accept input

Steps = input (Number of Steps: ")

# Calculate distance

distance = float(2000) * float(steps)

#Print Formatted Result

print('%0.2f' % distance)

# End of Program

.--------

The above program converts number of steps to miles.

At line 5, the number of steps is inputted and stored in variable named Steps.

At line 6, the number of miles is calculated by multiplying 2000 by the content of variable Steps

The result is printed at line 8

8 0
3 years ago
Read 2 more answers
Other questions:
  • Sed is a multipurpose tool that combines the work of several filters. sed performs noninteractive operations on a data stream. s
    12·1 answer
  • A gear box’s shaft is made of a hollow circular steel tube with allowable yield stress equal to σa????????o???? . The shaft is l
    7·1 answer
  • #198. Moment of inertia about center of a segmented bar A bar of width is formed of three uniform segments with lengths and area
    7·1 answer
  • The development of various technologies led to many historic events. Use information from the Internet to describe one major his
    5·1 answer
  • What are the different branches of engineering involved in manufacturing a general-purpose elevator?
    6·1 answer
  • Exercise 5.46 computes the standard deviation of numbers. This exercise uses a different but equivalent formula to compute the s
    12·1 answer
  • A beam spans 40 feet and carries a uniformly distributed dead load equal to 2.2 klf (not including beam self-weight) and a live
    15·1 answer
  • Do you think the industrial revolution helped or hurt workers? Why?
    8·1 answer
  • What are the disadvantages of military shovels?
    12·1 answer
  • A ruptured desiccant bag in a reciever-driver is usually caused by what?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!