Homework

Homework Questions? Ask a Tutor for Answers ASAP

Ask an Expert,
Get an Answer ASAP!

Homework
This answer was rated:

Drink Machine SimulatorWrite a program that simulates a

Drink Machine Simulator Write a program...
Drink Machine Simulator

Write a program that simulates a soft drink machine. The program should use a structure that stores the following data: Drink Name, Drink Cost and Number of drinks in Machine
The program should create an array of five structures. The elements should be initialized with the following data:
Drink Name Cost Number in Machine
Coca-Cola .75 20
Root Beer .75 20
Sprite .75 20
Spring Water .80 20
Apple Juice .80 20

Please create and use a input file. Each time the program runs, it should read the data from the input file and then enter a loop that performs the following steps: A list of drinks is displayed on the screen. The user should be allowed to either quit the program or pick a drink. If the user selects a drink, he or she will next enter the amount of money that is to be inserted into the drink machine. The program should display the amount of change that would be returned and subtract one from the number of that drink left in the machine. If the user selects a drink that has sold out(note-select Root Beer, since we start with 0 in the machine), a message should be displayed. The loop then repeats. When the user chooses to quit the program it should display the total amount of money the machine earned and a current inventory list(i.e. What is left in the machine).
Input validation: Only accept positive values for the amount of money. Also, do not accept values greater than 1.00.
-Have project description, function headers, and inline comments



Optional Information:
Programming Language: c++
Show More
Show Less
Ask Your Own Homework Question
Answered in 2 minutes by:
4/28/2013
ATLProg
ATLProg, Software Engineer
Category: Homework
Satisfied Customers: 9,151
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified
Hello Welcome. Thank you for your question, I’m ATLProg and I’ll try to help you.
Ask Your Own Homework Question
Customer reply replied 4 years ago


Thank you. You wrote the program before for a student, and I cannot firgure it out.

By when you need this done Efrain
Ask Your Own Homework Question
Customer reply replied 4 years ago

Tomorrow please. I am going to have to review it so I can learn it as well because I will be tested on it.

ok, stay here..
Ask Your Own Homework Question
Customer reply replied 4 years ago

Awesome, thank you.

Which was the previous question link where you saw this answered ?
Ask Your Own Homework Question
This answer is protected
Would you like to ask this question?
If you've already paid for this answer, simply Login.
ATLProg
ATLProg, Software Engineer
Category: Homework
Satisfied Customers: 9,151
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified
ATLProg and 87 other Homework Specialists are ready to help you
Ask your own question now
Have you been able to review the answer ? Can I assist you with anything with regards XXXXX XXXXX question ?
Ask Your Own Homework Question
Customer reply replied 4 years ago


Are you going to be available Tuesday at 6pm? I will have another program that I will need help with, and only have an hour to complete.

Can we do like 8 pm EST tuesday ?
Ask Your Own Homework Question
Customer reply replied 4 years ago


The test is from 6-715pm. That is the window that I log in for it.

Can we start at 7 PM EST then ? and how much time will we have ?
Ask Your Own Homework Question
Customer reply replied 4 years ago


The window for the assignment is 6pm to 730pm EST

ok, I will try to be present..
Ask Your Own Homework Question
Customer reply replied 4 years ago

I was checking to see if you would be available today at 6pm still? Since it is more urgent and we are on a time restraint, I will pay you 75 for this.

Yes , Sorry this particular requirement has just been a pain and I have been tryign to do all kinds of things !
Ask Your Own Homework Question
Customer reply replied 4 years ago

I understand, I was very pleased with your work, so I just wanted to make sure you were available, otherwise I would ask someone else. I will send you the task once it is open, and I will have til 715 to complete it.

Before you open can you check with me that I am online...like 15 mins back ?
Ask Your Own Homework Question
Customer reply replied 4 years ago

Will do.

Thanks
Ask Your Own Homework Question
Customer reply replied 4 years ago

I am about to drive over to the testing site, was checking to see if you were online or would be online. I wont be able to open a computer til 6pm on the nose

Customer reply replied 4 years ago

I need help with a new problem:

#include <cstdlib> #include <iostream> // include the header needed for formatting output using namespace std; // Global constants // Note: feel free to lower the # XXXXX programing exercises/quizzes for // testing purposes. const int MAX_NAME_SIZE = 25; // first and last name size const int NUM_PROG_EX = 9; // number of programming exercises const int NUM_QUIZZES = 9; // number of quizzes // Structure to hold StudentInfo struct StudentInfo { int studentID; // to hold student ID char name[MAX_NAME_SIZE]; // to hold first and last name int progExercises[NUM_PROG_EX];// to hold all programming exercise scores int quizzes[NUM_QUIZZES]; // to hold all quizz scores int midTerm; // mid term exam score int final; // final exam score }; // function prototypes void getStudentInfo(StudentInfo [], int ); void displayStudentInfo(StudentInfo [], int ); int findMinIndex(const int [], int ); double getAVG(const int [], int , int ); double calculateFinalScore(double , double , int , int ); char assignLetterGrade (int ); void displayReport(int , char [], double , char ); void clearKBD(); int main(int argc, char *argv[]) { const int NUM_STUDENTS = 3; // number of students in the class // Note: feel free to lower the number of students for testing purposes. // For example NUM_STUDENTS = 1 to test just for youself // declare an array of students in the next line // call the function that will populate students array with data // calculated values int minIndexPE; // index of the lowest prog. exercises score int minIndexQuizzes; // index of the lowest quiz score double avgPE; // prog. exercise average without the lowest score double avgQuizzes; // quiz average score without the lowest score double finalScore; // final grade (numeric) char letterGrade; // A, B, C, D, F for (int i=0; i<NUM_STUDENTS; i++) { // call the function to get the index of the lowest prog. exercise // score. store the return value from the function call into minIndexPE // variable minIndexPE = ??? // call the function to get the index of the lowest quiz score. Store // the return value in minIndexQuizzes variable minIndexQuizzes = ??? // call the function to compute the the average prog exercise score // without the lowest score. store the return value in the avgPE // variable avgPE = ??? // call the function to compute the the average quiz score // without the lowest score. Store the return value onto avgQuizzes // variable avgQuizzes = ??? // call the function to calculate the final (numeric) grade // store the result of the function call in variable finalScore finalScore = ??? // call the function to assign the letter grade based on the final // score. Store the result of the function call in variable letterGrade // Note: you may need to convert the final score (a double) to an int // for this call! letterGrade = ??? // call the displayReport function with the above calculated // variables as arguments. You may need to supply some other // arguments as well. } system("PAUSE"); return EXIT_SUCCESS; } //***************************************************************************** // Function : displayReport // Peturns : void // Parameters : sID (input) - studentID for the current student // sName (input) - student name // finalScore (input) - calculated numberica final score // finalGrade (input) - assigned letter grade // Description : This function displays student record nicely formatted //***************************************************************************** void displayReport(int sID, char sName[], double finalScore, char finalGrade) { // display StudentID, StudentName, FinalScore (numeric), letterGrade } //***************************************************************************** // Function : calculateFinalScore // Peturns : double // Parameters : progExAVG (input) - average of all programming exercises // not including the lowest score // quizAVG (input) - average of all quizzes not including the // lowest score // midTerm (input) - mid term exam score // finalExam (input) - final exam score // Description : This function calculates the final grade (numeric) according to // the following formula: // finalGrade = (progExercisesAvg * 0.75) + // (quizAvg * 0.10) + // (midTerm * 0.05) + // (finalExam * 0.10) //***************************************************************************** double calculateFinalScore(double progExAVG, double quizAVG, int midTermExam, int finalExam) { // calculate and return the final (numeric) score } //***************************************************************************** // Function : findMinIndex // Peturns : int // Parameters : myArray (input) - array with all programming exercise scores // size (input) - the size of the array // Description : This function returns the index of the lowest element in the // myArray. //***************************************************************************** int findMinIndex(const int myArray[], int size) { // find the minimum value in the array and return its index } //***************************************************************************** // Function : getAVG // Peturns : double // Parameters : myArray (input) - array with all programming exercise scores // size (input) - the size of the array // minIndex (input) - index of the lowest score // Description : This function calculates the average of the values in the // myArray by skipping over (not taking into consideration) the // lowest value in the array. The minIndex parameter refers to // the lowest array value. The function then returns the average. //***************************************************************************** double getAVG(const int myArray[], int size, int minIndex) { // calculate the average, but be sure to exclude the value referenced // by the minIndex. // return the calculate average } //***************************************************************************** // Function : assignLetterGrade // Peturns : char // Parameters : finalScore(input) - final score // Description : This function calculates a letter grade for the final (numeric) // score based on the following scale: // 90-100 A // 80-89 B // 70-79 C // 60-69 D // 0-59 F // The function then returns the letter grade. //***************************************************************************** char assignLetterGrade (int finalScore) { // code to assign letter grade based on the scale (see the description // above). // return the assigned letter grade } //***************************************************************************** // Function : getStudentInfo // Peturns : void // Parameters : myStudents(input/output) - an array of StudentInfo structs // size (input) - the size of the array // Description : This function prompts the user for student information and // stores obtained information into student array. //***************************************************************************** void getStudentInfo(StudentInfo myStudents[], int size) { for (int i=0; i<size; i++) { // get the student ID // store the studentID in the appropriate field in current student // structure // clear the keyboard buffer clearKBD(); // get the student name // store the studentName in appropriate field in current student // structure // get student's programming exercise scores (all of them) // You may need to use clearKBD // store them accordingly. // get student's quiz scores (all of them) // You may need to use clearKBD // store them accordingly // get the mid-term // store the mid-term grade in appropriate field in current student // structure // get the final exam grade // store the final exam grade in appropriate field in current student // structure } // end of for loop } //***************************************************************************** // Function : clearKBD // Peturns : void // Parameters : none // Description : This is a helper function used to clear the keyboard buffer. //***************************************************************************** void clearKBD() { cin.clear(); cin.sync(); }

Sorry I was out...
Ask Your Own Homework Question
Customer reply replied 4 years ago

I need help with a new problem, but I didnt know how to request you

I see other expert had posted on new question.can you request him to opt out and let him know you want to work with me if thats the case
Ask Your Own Homework Question
Customer reply replied 4 years ago

How do i do that? I would prefer working with you since I have worked with you before

Customer reply replied 4 years ago

I guess he already started working on it. How do I know when you are online for the future? I am going to need 4 more programs. I honestly dont know how you guys do it, I dont get it. I am an IT major with a focus on Network security

Just start question with for atlprog
Ask Your Own Homework Question
Ask ATLProg Your Own Question
ATLProg
ATLProg
ATLProg, Software Engineer
Category: Homework
Satisfied Customers: 9,151
9,151 Satisfied Customers
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML

ATLProg is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

Meet the Experts:

LogicPro

LogicPro

Engineer

5,731 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Manal Elkhoshkhany

Tutor

4,551 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

Chris M.

M.S.W. Social Work

2,636 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

F. Naz

Chartered Accountant

2,161 satisfied customers

Experience with chartered accountancy

Bizhelp

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
I need help with Exam Number: 00701400 Lesson Name: General
I need help with Exam Number: 00701400Lesson Name: General Math I, Study Unit 2 Pennfoster test… read more
GLENN
GLENN
Master of Mathematics
343 satisfied customers
Answer all three questions and don't exceed 600 words for
Answer all three questions and don't exceed 600 words for each answer while using at least two references to support your answers for each question adopting APA citation in the text and in the referen… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
QUESTION 1 A(n) _________________ policy are codified as
QUESTION 1A(n) _________________ policy are codified as standards and procedures that are used when configuring or maintaining systems.0.10000 points Save AnswerQUESTION 2In systems analysis and desig… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
I need all the questions answered inthis pdf! I need all
I need all the questions answered inthis pdf! I need all sixty questions on all 21 pages answered!… read more
Steven, M.Acc.
Steven, M.Acc.
Instructor
Master\u0027s Degree
252 satisfied customers
Exam Number: 584002RR I need all t he questions answered in
Exam Number: 584002RR I need all t he questions answered in excel in this pdf file now! Asap!… read more
The-PC-Guy
The-PC-Guy
Bachelor\u0027s Degree
629 satisfied customers
How do you differentiate between an expression and an
How do you differentiate between an expression and an equation? Provide an example of each, where the two are either related to or similar to each other. … read more
GLENN
GLENN
Master of Mathematics
343 satisfied customers
Duane will use an open system LAN because he knows the open
Duane will use an open system LAN because he knows the open system will support varieties of hardware and software components made by different vendors. Steve will use a closed system LAN because he k… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
IT 278 Network Administration 1. Server roles and features
IT 278 Network Administration 1. Server roles and features can be added and updated through both a GUI installation and a Server Core installation. In a short essay, explain how to use Windows PowerSh… read more
David L.
David L.
Bachelor\u0027s Degree
6 satisfied customers
For LogicPro only. need help with this debugging to input it
For LogicPro only.need help with this debugging to input it into raptor// A high school is holding a recycling competition // This program allows a user to enter a student's // year in school (1 throu… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
5,731 satisfied customers
I need the answer key to penn american literature, 986174RR
I need the answer key to penn foster american literature, 986174RR 986175RR 986176RR 986177RR 986178RR … read more
GLENN
GLENN
Master of Mathematics
343 satisfied customers
For LogicPro only * Reading data strings from a file *
For LogicPro only* Reading data strings from a file * Convert from int based container to templates or generics based * Accommodate dynamic resizing using this algorithm: 1. Starting with a dynamic si… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
5,731 satisfied customers
Question 1 of 20: Select the best answer for the question.
Question 1 of 20 : Select the best answer for the question. 1. For what type of document would you use the landscape page orientation? A. Three-column brochure B. Business letter C. Legal contract D. … read more
Cher
Cher
JustAnswer Expert & Mentor;Teacher/Tutor
Masters Degree
1,381 satisfied customers
5 - 5 x 5 +5. What is the answer to 5 - 5 x 5 + 5? Only that
no, only that two people using order of operations keeps getting different answers… read more
GLENN
GLENN
Master of Mathematics
343 satisfied customers
Only for F.Naz Tutor. Kindly help with a research report,
Only for F.Naz Tutor.Kindly help with a research report, the links is http://www.mediafire.com/file/bmcea6dt278nw8w/report.txt… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
If I did not look at the description which says 4 cpu cores
if I did not look at the description which says 4 cpu cores and 6 gpu core to make TEN I wonder if you can bundle the two to make an advertisement that says 10 core I also have others in the same fiel… read more
Pete
Pete
Engineer
Bachelor\u0027s Degree
1,124 satisfied customers
1. You've formatted the first paragraph of a document. What
1. You've formatted the first paragraph of a document. What button can you use to apply the formatting from the first paragraph to the next paragraph in the document? A. Cut B. Paste C. Copy D. Format… read more
Cher
Cher
JustAnswer Expert & Mentor;Teacher/Tutor
Masters Degree
1,381 satisfied customers
Below is the Sketch of the improved parking lot from 36
Below is the Sketch of the improved parking lot from 36 available parking spaces to 51 total parking spaces with 15 newly added parking spaces. The design was 4 rows were made from previously 3 rows. … read more
GLENN
GLENN
Master of Mathematics
343 satisfied customers
Question 3 of 20: Select the best answer for the question.
Question 3 of 20 : Select the best answer for the question. 3. Circular errors are caused by adding the cell name of a/an _______ cell to a formula. A. adjacent B. absolute C. active D. relativeQuesti… read more
Chris M.
Chris M.
M.S.W. Social Work
Master's Degree
2,636 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x