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 doubles. 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.

Answers

Answer 1
Answer:

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;

}


Related Questions

The 15-kg block A slides on the surface for which µk = 0.3. The block has a velocity v = 10 m/s when it is s = 4 m from the 10-kg block B. If the unstrectched spring has a stiffness k = 1000 N/m, determine the maximum compression of the spring due to the collision. Assume the collision is perfectly plastic. Take e=0.6 .
write an interface downloadable that has a method "geturl" that returns the url of a downloadable object
A refrigeration system was checked for leaks. The system temperature and surroundings were 75°F when the system was charged with nitrogen to 100 psig. The temperature then dropped to 50°F. What should the pressure be if no nitrogen has escaped?A) 9 psigB) 94 psigC) 100 psigD) 90 psig
A bathroom scale uses four internal strain gauges to measure the displacement of its diaphragm as a means for determining load. Four active gauges are used in a bridge circuit. The gauge factor is 2, and the gauge resistance is 120 Ω for each gauge. If an applied load to the diaphragm causes a tensile strain on R1 and R4 of 40 x 10-6, while gauges R2 and R3 experience a compressive strain of 40 x 10-6, estimate the bridge deflection voltage. The supply voltage is 5 V. a,b,c or d? a.400 x 10-6 V b.600x10-6V c.800x10-6V d.1000 x 10-6 V
An industrial load with an operating voltage of 480/0° V is connected to the power system. The load absorbs 120 kW with a lagging power factor of 0.77. Determine the size of the capacitor in vars that is necessary to raise the power factor to 0.9 lagging.

The hot water needs of an office are met by heating tab water by a heat pump from 16 C to 50 C at an average rate of 0.2 kg/min. If the COP of this heat pump is 2.8, the required power input is: (a) 1.33 kW (d) 10.2 kW (b) 0.17 kW (c) 0.041 kW

Answers

Answer:

option B

Explanation:

given,

heating tap water from 16° C to 50° C

at the average rate of 0.2 kg/min

the COP of this heat pump is 2.8

power output = ?

COP = (Q_H)/(W_(in))\nW_(in) = (Q_H)/(COP)\nW_(in) = ((0.2)/(60)* 4.18* (50-16))/(2.8)\nW_(in) = 0.169

the required power input is 0.169 kW or 0.17 kW

hence, the correct answer is option B

Young students show a preference for which modality?

Answers

Answer. In the present study, it was found that 61% students had multimodal learning style preferences and that only 39% students had unimodal preferences. Amongst the multimodal learning styles, the most preferred mode was bimodal, followed by trimodal and quadrimodal respectively 

Explanation:

Water exiting the condenser of a power plant at 45 Centers a cooling tower with a mas flow rate of 15,000 kg/s. A stream of cooled water is returned to the condenser at the same flowrate. Makeup water is added in a separate stream at 20 C. Atmosphericair enters the cooling tower at 30 C, with a wet bulb temperature of 20 C. The volumetric flow rate of moist air into the cooling tower is 8000 m3/s. Moist air exits the tower at 40C and 90% RH. Assume atmospheric pressure is at 101.3 kPa. Determine: a.T

Answers

Answer: hello your question is incomplete below is the missing part

question :Determine the temperature of the cooled water exiting the cooling tower

answer : T  = 43.477° C

Explanation:

Temp of water at exit = 45°C

mass flow rate of cooling tower = 15,000 kg/s

Temp of makeup water = 20°C

Assuming an atmospheric pressure of = 101.3 kPa

Determine temperature of the cooled water exiting the cooling tower

Water entering cooling tower at 45°C

Given that Latent heat of water at 45°C = 43.13 KJ/mol

Cp(wet air) = 1.005+ 1.884(y1)

where: y1 - Inlet mole ratio = (0.01257) / (1 - 0.01257) = 0.01273

Hence : Cp(wet air) = 29.145 +  (0.01273) (33.94) = 29.577 KJ/kmol°C

First step : calculate the value of Q

Q = m*Cp*(ΔT) + W(latent heat)

Q = 321.6968 (29.577) (40-30) +  43.13 (18.26089)

Q =  95935.8547 KJ/s

Given that mass rate of water = 15000 kg/s

Hence the temperature of the cooled water can be calculated using the equation below

Q = m*Cp*∆T

Cp(water) = 4.2 KJ/Kg°C

95935.8547 = (15000)*(4.2)*(45 - T)

( 45 - T ) = 95935.8547/ 63000.    ∴ T  = 43.477° C

Calculate the angle of banking on a bend of 100m radius so that vehicles can travel round the bend at 50km/hr without side thrust on the tyres.

Answers

Answer:

11.125°

Explanation:

Given:

Radius of bend, R = 100 m

Speed around the bend = 50 Km/hr = (5)/(18)*50 = 13.89 m/s

Now,

We have the relation

\tan\theta=(v^2)/(gR)

where,

θ = angle of banking

g is the acceleration due to gravity

on substituting the respective values, we get

\tan\theta=(13.89^2)/(9.81*100)

or

\tan\theta=0.1966

or

θ = 11.125°

The tool that can be used to depict main causes for an identified quality problem, subdivided into categories represented as machines, materials, methods, and manpower, is called a ____________.

Answers

It is called an Cause-and-effect diagram.

Select the true statements regarding rigid bars. a. A rigid bar can bend but does not change length.
b. A rigid bar does not bend regardless of the loads acting upon it.
c. A rigid bar deforms when experiencing applied loads.
d. A rigid bar is unable to translate or rotate about a support.
e. A rigid bar represents an object that does not experience deformation of any kind.

Answers

Answer:

option b and E are true

Explanation:

A lever is an example of a rigid bar that can rotate around a given point. In a rigid material, the existing distance does not change whenever any load is placed on it. In such a material, there can be no deformation whatsoever. Wit this explanation in mind:

option a is incorrect, given that we already learnt that no deformation of any kind happens in a rigid bar.

option b is true. A rigid bar remains unchanged regardless of the load that it carries.

option c is incorrect, a rigid bar does not deform with loads on it

option d is incorrect. A lever is a type of rigid bar, a rigid bar can rotate around a support.

option e is true. A rigid bar would not experience any deformation whatsoever.