Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program to simulate the operation of a soda vending machine. For simplic

ID: 3569185 • Letter: W

Question

Write a program to simulate the operation of a soda vending machine. For
simplicity, assume that the machine has only 3 kinds of products: SPRITE, FANTA, and WATER, each offered in either a can or bottle container (so 6 types in total).
Assume that we model each product with the following class:
class Product
{
public:
Product() // constructor
void setName(char name[]);
void setContainerType(int containerType);
void setUnitCost(float);
void setQuantity(unsigned int qty);
int getUnitCost(char name[], int containerType);
bool purchaseOne(char name[]);
int getQuantity()
private:
char name[20];
int containerType;
float unitCost;
float balance;
};
where

Explanation / Answer

#include<stdio.h>

Struct machine

{

Int select;

Int price;

Int pay;

Char display;

};

Int main()

{ struct machine drinks[6]={

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote