Question

Be sure to include documentation in your program. Submit both your program code and a screenshot...

Be sure to include documentation in your program. Submit both your program code and a screenshot of your running program in a word processing document. Sam’s Subs, a sandwich shop, specializes in fast delivery of submarine sandwiches. Sam has hired you to write C++ programs for their business. Write a program that calculates the amount of change that a delivery driver owes a customer. For example, if the driver enters a sales amount of $6 and a cash received amount of $10, the program displays $4 as change due to the customer.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream>

using namespace std;

int main()
{
  
int sales,cash;
//reading sales amount
cout<<"Enter the sales amount : ";
cin>>sales;
// reading the cash amount
cout<<"Enter the cash received : ";
cin>>cash;
//checking if cach is greater than sales to give change
if(cash>sales){
// displaying the change
cout<<"Change :$"<<cash-sales;
}
return 0;
}

Add a comment
Know the answer?
Add Answer to:
Be sure to include documentation in your program. Submit both your program code and a screenshot...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write the pseudocode below as a working Python program. Take a screenshot of your code and...

    Write the pseudocode below as a working Python program. Take a screenshot of your code and output and paste into your answer document. User input of ‘y’ or ‘Y’ should cause the loop to continue.    // Constant for the commission rate    // Declare as a global variable    Constant Real COMMISSION_RATE = 0.10     Module main()        // Local variable         Declare String keepGoing = "y"         // Calculate as many commissions         // as needed.         While...

  • CODE IN C++ PLEASE INCLUDE A SCREENSHOT OF YOUR CODE Write a program that outputs the...

    CODE IN C++ PLEASE INCLUDE A SCREENSHOT OF YOUR CODE Write a program that outputs the shortest distance from a given node to every other node in the graph. Do not change anything in the supplied code below that will be the Ch20_Ex3.cpp except to add documentation and your name. Please use the file names listed below since your file will have the following components: Note: Here are the files that I need graphType.h linkedList.h linkedQueue.h queueADT.h unorderedLinkedList.h weightedGraph.h #include...

  • Use both pseudocode and flowcharts to solve the problems below: 1. Write a program that converts...

    Use both pseudocode and flowcharts to solve the problems below: 1. Write a program that converts a user-entered Fahrenheit temperature to equivalent Celsius temperature. Use the formula c = (5 / 9) * (f - 32) where c is representing a Celsius temperature and f a Fahreinheit temperature. 2. A program is required that will read two operands and print the product to a file. 3. A program will ask the user to enter his/her name. Upon entering the name...

  • Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the...

    Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment also aims at creating a C++ project to handle multiple files (one header file and two .cpp files) at the same time. Remember to follow documentation and variable name guidelines. Create a C++ project to implement a simplified banking system. Your bank is small, so it can have a maximum of...

  • Read and Complete Case Study #2 –Managing People. The central components of your analysis should include issue identific...

    Read and Complete Case Study #2 –Managing People. The central components of your analysis should include issue identification, issue analysis, solutions, and potential limitations to your solutions. The case analyses serve to: a) Provide an opportunity to apply the class concepts in the solution of practical problems. b) Provide you with a common task through which you can learn to be more effective thinkers and problem-solves in your organizations. The written case analysis will be evaluated based on your effectiveness...

  • If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but...

    If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT