Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c++ Write the code for the following procSale function. Its purpose is to take the array of Vendltem structures (first argument), the selection (2nd

In c++

image text in transcribed

Write the code for the following procSale function. Its purpose is to take the array of Vendltem structures (first argument), the selection (2nd argument, which is also the array item to purchase), and the cash (3rd argument, which is the amount offered to pay for the item) and produce the following results: If the cash is more than $1.00, output the message "Cash amount too large!" and return. . If the cash is less than the price of the item selected, output the message "Not enough cash!", and return. .If there are no items left for the selection, output "No XXXXX left!" and return. . If the cash is- or > price of the item selected, and there are items available for the selection: Output the message: "XXXXXX purchased, your change is OYY" (where XXXXX is the drinkname and OYY is the change) Subtract 1 from the number of items available for the selection Assume you have the following global declarations for a Vendltem given: struct VendItem string itemName; double price; //all prices are 1.00 and multiples of.05 int numLeft; 1i const int SIZE-8; void procSale(VendItem vendInfo[SIZE], int selection, double cash)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

using the tutorials and help features

Answered: 1 week ago

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago