SlideShare a Scribd company logo
#include <iostream> //Bring library to program
using namespace std; //Behave normally
void main() { //The instructions to follow
int NumCokes = 5; //Create an integer called NumCokes and store the value 5
inside, then move onto the next line
int NumSprites = 6; //Create an integer called NumSprites and store the value 6
inside, then move onto the next line
int Choice; //Create an integer called Choice, we will store a value inside later.
Move onto the next line
cout << "Insert $1.25" << endl; //Display "Insert $1.25" and follow with a
Carriage Return. Move onto the next line
cout << "Make Selection" << endl; //The start of the drink menu, follow with a
Carriage Return. Move onto the next line
cout << "Press 1 for Coke and 2 for Sprite" << endl; //Drink Menu
cin >> Choice; //Accept an input from the user and store the value inside
Choice, then move onto the next line
if (Choice == 1) { NumCokes -= 1; } else { NumSprites -= 1; } //Action from
the user selection. Inventory update.
cout << "There are: " << NumCokes << " Cokes and " << NumSprites << " Sprites
remaining." << endl; //Output of the inventory
system("PAUSE"); //Press any key to continue
}

More Related Content

PDF
PHP Programming: Intro
ODP
UTAU DLL voicebank and ulauncher
PDF
Can someone run this and take a screen shot of it and post it, it is.pdf
TXT
File handling complete programs in c++
DOCX
Project fast food automaton
TXT
Data Structures : array operations in c program
DOCX
CS Project-Source code for shopping inventory for CBSE 12th
DOCX
computer project on shopping mall..cbse 2017-2018 project
PHP Programming: Intro
UTAU DLL voicebank and ulauncher
Can someone run this and take a screen shot of it and post it, it is.pdf
File handling complete programs in c++
Project fast food automaton
Data Structures : array operations in c program
CS Project-Source code for shopping inventory for CBSE 12th
computer project on shopping mall..cbse 2017-2018 project

Similar to Harrigan_Danielle_Programming (20)

TXT
c++ project on restaurant billing
TXT
c++ program for Canteen management
PDF
Reshma Kodwani , BCA Third Year
DOCX
Canteen management
DOCX
c++main.cpp#include iostream#include store.h#includ.docx
DOC
Project hotel on hotel management fo
PDF
Kirti Kumawat, BCA Third Year
DOC
Shopping mall
DOCX
CS 2336 PROJECT 3 – Linked Inventory Management Project Due 1104 b.docx
PDF
So I already have most of the code and now I have to1. create an .pdf
PPTX
cafeteria info management system
DOCX
#include iostream#include stringusing namespace std;.docx
PDF
#includeiostream #includefstreamusing namespace std; glo.pdf
PDF
fully comments for my program, thank you will thumb up#include io.pdf
PDF
Please help me understand why when I run my code it does not make me.pdf
DOCX
Supermarket
DOCX
ObjectivesUse inheritance to create base and child classes.docx
DOCX
DOCX
Computer Science Project on Management System
DOCX
Use of Classes and functions#include iostreamusing name.docx
c++ project on restaurant billing
c++ program for Canteen management
Reshma Kodwani , BCA Third Year
Canteen management
c++main.cpp#include iostream#include store.h#includ.docx
Project hotel on hotel management fo
Kirti Kumawat, BCA Third Year
Shopping mall
CS 2336 PROJECT 3 – Linked Inventory Management Project Due 1104 b.docx
So I already have most of the code and now I have to1. create an .pdf
cafeteria info management system
#include iostream#include stringusing namespace std;.docx
#includeiostream #includefstreamusing namespace std; glo.pdf
fully comments for my program, thank you will thumb up#include io.pdf
Please help me understand why when I run my code it does not make me.pdf
Supermarket
ObjectivesUse inheritance to create base and child classes.docx
Computer Science Project on Management System
Use of Classes and functions#include iostreamusing name.docx
Ad

More from Danielle Harrigan (10)

PDF
Flowers on Broad Street
PDF
Terry Williams
PDF
Western Wake
PDF
Bereavement Camp
PDF
Cause and Effect Project
PPTX
Harrigan_Danielle_Presentation (1)
PDF
Visio Chart PDF
DOCX
Business Proposal
PDF
Donkey Farm Article
PDF
USA Padget
Flowers on Broad Street
Terry Williams
Western Wake
Bereavement Camp
Cause and Effect Project
Harrigan_Danielle_Presentation (1)
Visio Chart PDF
Business Proposal
Donkey Farm Article
USA Padget
Ad

Harrigan_Danielle_Programming

  • 1. #include <iostream> //Bring library to program using namespace std; //Behave normally void main() { //The instructions to follow int NumCokes = 5; //Create an integer called NumCokes and store the value 5 inside, then move onto the next line int NumSprites = 6; //Create an integer called NumSprites and store the value 6 inside, then move onto the next line int Choice; //Create an integer called Choice, we will store a value inside later. Move onto the next line cout << "Insert $1.25" << endl; //Display "Insert $1.25" and follow with a Carriage Return. Move onto the next line cout << "Make Selection" << endl; //The start of the drink menu, follow with a Carriage Return. Move onto the next line cout << "Press 1 for Coke and 2 for Sprite" << endl; //Drink Menu cin >> Choice; //Accept an input from the user and store the value inside Choice, then move onto the next line if (Choice == 1) { NumCokes -= 1; } else { NumSprites -= 1; } //Action from the user selection. Inventory update. cout << "There are: " << NumCokes << " Cokes and " << NumSprites << " Sprites remaining." << endl; //Output of the inventory system("PAUSE"); //Press any key to continue }