Dev C%2b%2b Vending Machine Program

The first three people to complete this program will be entered into the annual contest for Top Coder! The grand prize is the chance to become one of TopCoders independent programmer. This is a special opportunity to get paid for programing projects that you create. Below is the program to be written. It appears simple but details are a priority.

  1. Dev C++ Vending Machine Program Manual Pdf
  2. Dev C 2b 2b Vending Machine Program Free

Vending Machine

Software Features. The rich features in the Vendron software are provided by various plugins below, which are continuously developed and expanded. (May require custom development subject to types of vending machine controller board). We design and manufacture custom vending machines and automated retail solutions. We love to innovate. C program of drinking/vending machine - The User get menu similar to real vending machine and from there any drink can be ordered after paying money in dollar. CppBuzz.com Home C C Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test ☰.

Write a complete C++ program which will produce the sample runs shown at the end.

You will first ask the user to choose a school (ASU or UA) or to quit the program. If a school is chosen, display a menu to access that school's vending machine. Below is the menu and the starting amounts in each machine.

[school] Vending Machine Main Menu
-----------------------------
A. Get Soda - $ .65
B. Change Brand
C. Restock Soda
D. Leave This Machine
-----------------------------

[school] Vending Machine
------------------------
Type Stock
------------------------
Coke 10
Orange 8
Dew 6
Ice Tea 4
Evian 2
space available 0


The following is an explanation of each menu choice:

Get Soda
This menu choice displays the vending machine. It lists out the 6 different sodas available and how many are in stock.
See the list above for starting types and amounts.

Change Brand
This allows the user to swap out one soda for a different brand of soda. The user will be prompted for the new soda's name and the name of the old soda to be replaced. The new soda will begin with five (5) cans of soda. If the user does not type in the exact name of the old soda, an error message will display, because the program will not be able to match the names. The user may not remove the Coke. This will be one of your assumptions.

Restock Soda
The user will type in the name of the soda to be restocked. If the user does not type in the exact name of the old soda, an error message will display, because the program will not be able to match the names. If there is a soda name match, the user can restock the soda with 20 cans.

Leave this menu
Leaves the menu and again asks for a school or quit the program.


If the user choose to quit the progarm, the program states Whose machine has more Coke left and how many Cokes each school has. (See the Sample Runs below.)

All user input must be error checked. If it is out of range, an appropriate error message must be generated and the user must be prompted again. String input is case sensitive while character input is case insensitive. (See the Sample Runs below.)

You may wish to use the following two system calls. Each is a simple statement.

system('CLS');
This command will clear the screen.

system('PAUSE');
This command will pause the screen. Great for displaying reports. This command causes the onscreen message of 'Press any key to continue . . .' in the following sample output. Once the user presses any key, you want the main menu to display again.

Unified Modeling Language (UML)
The UML is an open method used to specify, visualize, construct and document an object-oriented program.
The diagram shown here is very simplified example of one. I recommend you read the notes on the homepage under
Handouts > Class/Struct > A Very Quick Overview

You may think of this as the pseudocode of your class. The first part is the name of the class, the second part is a list of attributes, and the third part is a list of behaviors. Public behaviors amd attributes are preceded by a + (plus) and private behaviors and attributes are preceded buy a – (minus).

An example of the pseudocode for this assignment is in the diagram shown here.

VendingMachine
-brand[6];
-inStock[6];
-price
+getBrand
+setBrand
+getInStock
+setInStock
+decrementStock
+getprice


The major purposes of this assignment are to demonstrate:
# good design, particularly pseudocode
-- Just because your program produces the correct output does not mean that the program is correct.
# the ability to use UML diagrams as part of the design
# the appropriate use of classes.
# good programming practices, including pre- and post-conditions

Hints:
An array can be made up of any data type.
A user defined class is a data type.
setInStock() sets the number of cans for a particular item
decrementStock() will reduce, by one, the number of cans for a particular item

Assumption(s): ?

Helpful Code: If you decide to use this code, you must change the identifiers. Items that require reference to a class are listed as ???.
Put the DO loop in main().

Program requirements and/or constraints:
# Create your plan BEFORE you begin to write the code.
# Follow the Style Guide. All requirements stated there must be met.
# You must use a class in an appropriate manner. - No class, no points.
# All requirements of functions apply to methods.
# Include: structure chart for the client, pseudocode, pre- and post-conditions, etc.
# 'ASU' and 'UA' are case sensitive inputs.
# Validate all user input
# Use comments freely throughout the program.
# Make sure your pseudocode is typed.
# Do not use material beyond the current topic.
# Do your own work.

Be sure to hand-in in the appropriate envelope:
# The typed plan for your program (pseudocode)
Turn in a UML diagram as the pseudocode for the class.
# A structure chart (may be hand drawn)
# Hardcopy of your source code
# The top of your submission file must begin with the following:

/*

( 3 blank lines - This is where the graders will put your grade. )

*/

Submit your source code using the Submission/Retrieval feature on the homepage.

*Normally the source code would be in three separate files, the specification, the implementation, and the client. Our submission program permits a single file entry. Thus, combine the three files in one, preceed each section with a comment (specification, implementation, client). Also comment out any code that would be redundant for a single file submission. Your submission is expected to compile withour errors.


Sample runs: User input is represented by [ ].

Whose machine, ASU or UA? Type Q to quit. [ASU]

// new screen
ASU Vending Machine Main Menu
-----------------------------
A. Get Soda - $ .65
B. Change Brand
C. Restock Soda
D. Leave This Machine
-----------------------------
Enter your menu choice (A - D): [a]

ASU Vending Machine
----------------------------
Soda Type Stock
----------------------------
1. Coke 10
2. Orange 8
3. Dew 6
4. Ice Tea 4
5. Evian 2
6. space available 0
Enter your choice: [1]

Whose machine, ASU or UA? Type Q to quit. [ASU]

// new screen
ASU Vending Machine Main Menu
-----------------------------
menu appears
-----------------------------
Enter your menu choice (A - D):

ASU Vending Machine
----------------------------
Soda Type Stock
----------------------------
1. Coke 9
2. Orange 8
3. Dew 6
4. Ice Tea 4
5. Evian 2
6. space available 0
Enter the beverage to change: [Evian]
Enter the new brand: [Jolt]
Jolt replaces Evian and is stocked with 5 cans.
Press any key to continue . . . // This is NOT a return to the source code.

Whose machine, ASU or UA? Type Q to quit. [UA]

// new screen
UA Vending Machine Main Menu
-----------------------------
menu appears
-----------------------------
Enter your menu choice (A - D): [A]

UA Vending Machine
----------------------------
Soda Type Stock
----------------------------
1. Coke 10
2. Orange 8
3. Dew 6
4. Ice Tea 4
5. Evian 2 // Note that in the UA machine #5 is 'Evian'
6. space available 0
Enter your choice: [2]

Whose machine, ASU or UA? Type Q to quit. [UA]

// new screen
UA Vending Machine Main Menu
-----------------------------
menu appears
-----------------------------
Enter your menu choice (A - D): [d]

Whose machine, ASU or UA? Type Q to quit. [UA]

// new screen
UA Vending Machine Main Menu
-----------------------------
menu appears
-----------------------------
Enter your menu choice (A - D): [c]
Enter the beverage name: [Evian]
Evian is restocked with 20 cans.
Press any key to continue . . .

Whose machine, ASU or UA? Type Q to quit. UA

// new screen
UA Vending Machine Main Menu
-----------------------------
menu appears
-----------------------------
Enter your menu choice (A - D): [D]

Whose machine, ASU or UA? Type Q to quit. Q

UofA has more Coke left. ASU - 9 to UA - 10
ASU has 37 cans of soda and UofA has 47 cans of soda
Press any key to continue

Whose machine, ASU or UA? Type Q to quit. [asu]
Invalid entry. Case counts. Try again.
Whose machine, ASU or UA? Type Q to quit. [ASU]

// new screen
ASU Vending Machine Main Menu
-----------------------------
menu appears
-----------------------------
Enter your menu choice (A - D): [k]
Invalid entry. Use only A-F. Try again. [M]
Invalid entry. Use only A-F. Try again. [a]

ASU Vending Machine
----------------------------
Soda Type Stock
----------------------------
1. Coke 10
2. Orange 8
3. Dew 6
4. Ice Tea 4
5. Evian 2
6. space available 0
Enter your choice: [9]
Please enter only 1 - 6. Reenter your choice: [6]

No space available left. Make another selection.
Enter your choice: [4]

Whose machine, ASU or UA? Type Q to quit. [UA]

Dev C++ Vending Machine Program Manual Pdf

// new screen
UA Vending Machine Main Menu
-----------------------------
menu appears
-----------------------------
Enter your menu choice (A - D):

UA Vending Machine
----------------------------
Soda Type Stock
----------------------------
1. Coke 10
2. Orange 8
3. Dew 6
4. Ice Tea 4
5. Evian 2
6. space available 0
Enter the beverage to change: [WildCat]
The brand you entered is not on the list.
Press any key to continue . . .

Whose machine, ASU or UA? Type Q to quit. [AU]
Invalid entry. Case counts. Try again.
Whose machine, ASU or UA? Type Q to quit. [UA]

// new screen
UA Vending Machine Main Menu
-----------------------------
menu appears
-----------------------------
Enter your menu choice (A - D):[C]
Enter the beverage name: [Pepsi]
Pepsi is not on the list. Make a different selection.
Enter the beverage name: [Dew]
Dew is restocked with 20 cans.

Whose machine, ASU or UA? Type Q to quit. [UA]

// new screen
UA Vending Machine Main Menu
-----------------------------
menu appears
-----------------
Enter your menu choice (A - D): [a]

UA Vending Machine
----------------------------
Soda Type Stock
----------------------------
1. Coke 10
2. Orange 8
3. Dew 6
4. Ice Tea 4
5. Evian 2
6. Wild Cat 5
Enter your choice: [4]

Whose machine, ASU or UA? Type Q to quit. [K]
Invalid entry. Case counts. Try again.
Whose machine, ASU or UA? Type Q to quit. [q]

Dev C 2b 2b Vending Machine Program Free

ASU and UofA have the same amount of Coke, 10
ASU has 29 cans of soda and UofA has 43 cans of soda
Press any key to continue

  • 8 Contributors
  • forum7 Replies
  • 363 Views
  • 20 Hours Discussion Span
  • commentLatest PostLatest Postby Rashakil Fol

Recommended Answers

Dev C%2b%2b Vending Machine Program

What's the top prize again? How do I enter :rolleyes:

Jump to Post

What's the top prize again? How do I enter :rolleyes:

I think it is 29 cans of soda. Shall we share?

Jump to Post

All 7 Replies

What's the top prize again? How do I enter :rolleyes: