Ace - AI Tutor
Ask Our Educators
Textbooks
My Library
Flashcards
Scribe - AI Notes
Notes & Exams
Download App
james smith

james s.

Divider

Questions asked

BEST MATCH

1. Soda Machine simulator Write a program that simulates a soda machine. Implement this program in a file called soda.cpp. The program should work as follows: a. The program should define a structure named Soda that contains the following attributes: i. Soda name ii. Soda cost iii. Quantity available b. The program should initialize an array of five Soda structures with the following data in order: Soda name Cost Quantity Cola $1.50 30 Root Beer $1.40 20 Orange Soda $1.65 25 Seltzer Water $0.95 1 Ginger Ale $2.05 15 c. Before receiving user input, the program should display a menu detailing the available drinks (numbered 1-5), their costs (in dollar format), and quantity in a left-aligned fashion. d. The user should be able to select a drink (1-5) or quit (6) i. If the user enters an invalid menu selection, an appropriate error message should be displayed and they should be re-prompted for another selection. ii. If the user selects a drink that is out of stock, an out-of-stock message should be displayed and they should be re-prompted for another selection. e. After selecting a drink, the user should be able to input the amount of money they want to insert to pay. This machine only accepts non-zero values less than or equal to $5. i. If the user enters an invalid money amount, an appropriate error message should be displayed and they should be re-prompted for a valid amount. ii. If the user enters a money amount less than the cost of the drink selected, an insufficient-funds message should be displayed and they should be re-prompted for a valid amount. iii. If the user enters a valid money amount, the quantity of the selected drink should be decremented and the leftover change should be displayed in dollar format. f. When the user quits, the program should display the total revenue earned by the soda machine in dollar format. Example run 1 (underlined portions correspond to user input): 1) Cola $1.50 Qty: 30 2) Root Beer $1.40 Qty: 20 3) Orange Soda $1.65 Qty: 25 4) Seltzer Water $0.95 Qty: 1 5) Ginger Ale $2.05 Qty: 15 Select a soda or 6 to quit: $\underline{2}$ Invalid selection, please try again: $\underline{1}$ Enter money to insert: $\underline{10.00}$ This machine only accepts $5.00 or less Enter money to insert: $\underline{-2.00}$ Please enter a positive, non-zero dollar amount Enter money to insert: $\underline{2.00}$ Change: $0.50 1) Cola $1.50 Qty: 29 2) Root Beer $1.40 Qty: 20 3) Orange Soda $1.65 Qty: 25 4) Seltzer Water $0.95 Qty: 1 5) Ginger Ale $2.05 Qty: 15 Select a soda or 6 to quit: $\underline{4}$ Enter money to insert: $\underline{0.50}$ Insufficient funds Enter money to insert: $\underline{1.00}$ Change: $0.05 1) Cola $1.50 Qty: 29 2) Root Beer $1.40 Qty: 20 3) Orange Soda $1.65 Qty: 25 4) Seltzer Water $0.95 Qty: 0 5) Ginger Ale $2.05 Qty: 15 Select a soda or 6 to quit: $\underline{4}$ Seltzer Water is out of stock. Select a soda or 6 to quit: $\underline{3}$ Enter money to insert: $\underline{5.00}$ Change: $3.35 1) Cola $1.50 Qty: 29 2) Root Beer $1.40 Qty: 20 3) Orange Soda $1.65 Qty: 24 4) Seltzer Water $0.95 Qty: 0 5) Ginger Ale $2.05 Qty: 15 Select a soda or 6 to quit: $\underline{6}$ Total revenue: $5.05

View Answer
divider
BEST MATCH

a dart is inserted into a spring lodead dart gun and is pushing the spring by a distance x. The 2nd loading pushes the spring a distance 2x. How much faster does 2nd leave the gun than the first

View Answer
divider
BEST MATCH

What literature to review and why, when studying Fluid dynamics and epidemiology for Monkeypox in mathematics.

View Answer
divider
BEST MATCH

There is no market failure if O the demand curve lies about the marginal private cost curve. 4 O the demand curve (for a good or service) is downward sloping. O the marginal private cost curve is upward sloping. O the market provides the idea or socially optimal amount of a good. < Previous Qu

View Answer
divider
BEST MATCH

Question 5 Where does hematopoiesis occur? A Ends of long bones B Sesamoids C Yellow bone marrow D Cartilage Question 6 Which cell is correctly matched to its function? A Osteoclast: Builds bone B Osteospore: Breaks down bone C Osteoblast: Builds bone D Osteocyte: Breaks down bone

View Answer
divider
BEST MATCH

Physical needs at the end of life include: Question 5 options: Listening and respect Respect and pain relief Comfort and positioning Spiritual care

View Answer
divider
BEST MATCH

Prescription: Zofran 32 mg IV x 1 prior to chemotherapy. Zofran has 40 mg in a 20 ml vial. What volume will you administer?

View Answer
divider
BEST MATCH

A neutron star of mass $2 \times 10^{30}$ kg and radius 9.5 km rotates with a period of 0.024 seconds. What is its rotational kinetic energy? $KE_{rot} = \text{____} \times 10^{42} \text{ J}$

View Answer
divider
BEST MATCH

I need some help with a project making a wheel, it's for a course using Solidworks. Units: IPS (inch, pound, second) $\phi 2.400$ $\phi .800$ $\phi 3.240$ $\phi .290$ .330 R.050 TYP $\phi .500$ THRU $\phi .580$ BOTH SIDES $\phi 1.600$ BC 4PLCS .650 $160^\circ$ BOTH SIDES

View Answer
divider
BEST MATCH

Chemistry Theme 12 Assignment Questions for Extra Marks Level 2 Questions For an extra point, select and write the answers to any 3 questions. 1. How does retinoic acid (RA) lead to changes in gene expression? Give a scheme of its action. 2. How are the effects of vitamin A deficiency related to keratin, a fibrous protein that helps to prevent moisture loss in epithelia? Explain the answer. 3. Describe or give a diagram of the biological mechanism of vitamin D toxicity. 4. Describe the biochemistry of the participation of vitamin A in the visual act. In what reaction is the coenzyme of vitamin A used (name enzymes and coenzyme)? What role do cGMP and phosphodiesterase play in this process? CniBpo6iTHMK KaOegpM6iOXiMii TaMeg.

View Answer
divider