How JustAnswer Works:

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

Ask ATLProg Your Own Question

ATLProg
ATLProg, Software Engineer
Category: Homework
Satisfied Customers: 9151
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
44910485
Type Your Homework Question Here...
ATLProg is online now
A new question is answered every 9 seconds

Drink Machine SimulatorWrite a program that simulates a

This answer was rated:

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++
Hello Welcome. Thank you for your question, I’m ATLProg and I’ll try to help you.
Customer: replied 3 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
Customer: replied 3 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..
Customer: replied 3 years ago.

Awesome, thank you.

Which was the previous question link where you saw this answered ?
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
ATLProg and 4 other Homework Specialists are ready to help you
Have you been able to review the answer ? Can I assist you with anything with regards XXXXX XXXXX question ?
Customer: replied 3 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 ?
Customer: replied 3 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 ?
Customer: replied 3 years ago.


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

ok, I will try to be present..
Customer: replied 3 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 !
Customer: replied 3 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 ?
Customer: replied 3 years ago.

Will do.

Thanks
Customer: replied 3 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: replied 3 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...
Customer: replied 3 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
Customer: replied 3 years ago.

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

Customer: replied 3 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