Question

A local department store is having a BoGoHo (Buy One, Get One Half Off) sale. The store manager wants a program that allows the salesclerk to enter the prices of two items. The program should calculate and display the total amount the customer owes. The half-off should always be taken on the item having the lowest price. For example, if the items cost $24.99 and $10, the half-off would be taken on the $10 item. If both prices are the same, take the half-off on the second item. A+


How do you write out this C++ program and zip the files?

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

So if we have 2 Items, we need to add half of the Price of the Item having lesser Value.

So to Have a Program for that and to show the total, the Person Owes,

So, Starting the Program we have

#include

using namespace std;

int main()
{
float A,B,C,Total;
cout << "Enter Price of 1st Item:";
cin>>A;
cout<<"Enter Priceof 2nd Item:";
cin>>B;
if(A {
C=A/2;
Total=A+C;
}
else
{
C=B/2;
Total=A+C;
}
cout<<"Total Price= "< return 0;
}

Add a comment
Know the answer?
Add Answer to:
How do you write out this C++ program and zip the files? A local department store...
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
  • A store is having a sale. The manager wants a program that allows the sales clerk...

    A store is having a sale. The manager wants a program that allows the sales clerk to enter the original price of an item and the discount rate. The program should calculate and display the sale price. find the inputs and outputs, write the pseudocode, and desk check the pseudocode.

  • please write in C++ Write a program that uses a structure to store the following inventory...

    please write in C++ Write a program that uses a structure to store the following inventory data in a file: The data can be either read from a text file or the keyboard Item name (string) Quantity on hand(int) Wholesale cost(double) Retail Cost(double) The program should have a menu that allows the user to perform the following tasks: Add new records to the file Display any record in the file User will provide the name of the item or the...

  • Need this program in C#. Thank you 3/19 Lab11 PartC Dur Scenario/Summary Write a windows console...

    Need this program in C#. Thank you 3/19 Lab11 PartC Dur Scenario/Summary Write a windows console application that holds data about an item in a retail store. Your class should be named Retailltem and should hold data about an item in a retail store. The class will have the following member variables. Description- string holding the description of the item, unitsOnHand - int that holds the number of units in inventory Price - double that holds the price of the...

  • IN C# Write a program to help a local restaurant automate its lunch billing system. The...

    IN C# Write a program to help a local restaurant automate its lunch billing system. The program should do the following: Show the customer the different lunch items offered by the restaurant. Allow the customer to select more than one item from the menu. Calculate and print the bill. Assume that the restaurant offers the following lunch items (the price of each item is shown to the right of the item): Ham and Cheese Sandwich $5.00 Tuna Sandwich $6.00 Soup...

  • C program help: Write a C program that uses three functions to perform the following tasks:...

    C program help: Write a C program that uses three functions to perform the following tasks: – The first function should read the price of an item sold at a grocery store together with the quantity from the user and return all the values to main(). example: #include void getInput(int *pNum1, int *pNum2); // note: *pNum1 & *pNum2 are pointers to ints int main () {    int numDucks,numCats;    getInput(&numDucks, &numCats); // passing addresses of num1 & num2 to...

  • In C++ Programming Write a program in Restaurant.cpp to help a local restaurant automate its breakfast...

    In C++ Programming Write a program in Restaurant.cpp to help a local restaurant automate its breakfast billing system. The program should do the following: Show the customer the different breakfast items offered by the restaurant. Allow the customer to select more than one item from the menu. Calculate and print the bill. Assume that the restaurant offers the following breakfast items (the price of each item is shown to the right of the item): Name Price Egg (cooked to order)...

  • You have to write a java solution for a store. Part 1 The solution needs to...

    You have to write a java solution for a store. Part 1 The solution needs to have at least following features: ◦ Item: Name, ID (incremental ID by 1 for each product), Price. ◦ Store Basket: ID (incremental ID by 1 for each basket), Net Amount, Total Amount, VAT, List of items, Date and Time of purchase, Address of the store, name of cashier. ◦ Cashier: Name, Surname, Username and Password (insert from code five fixed cashiers). ◦ Manager: Name,...

  • Write C++ program T 1030 UUIII DUCOUL The bar code on an envelope used by the...

    Write C++ program T 1030 UUIII DUCOUL The bar code on an envelope used by the US Postal Service represents a five (or more) digit zip code using a format called POSTNET (this format is being deprecated in favor of a new system, OneCode, in 2009). The bar code consists of long and short bars as shown below: Illlllllllll For this program we will represent the bar code as a string of digits. The digit 1 represents a long bar...

  • C++ Retailltem.h, Retailltem.cpp, Store.h, Store.cpp, and Driver.cpp. Description: Write a set of programs that holds data...

    C++ Retailltem.h, Retailltem.cpp, Store.h, Store.cpp, and Driver.cpp. Description: Write a set of programs that holds data about items in a retail store. Your submission should include 5 files, Retailltem.b, Retailltem.cpp, Store, Store.cpp, and Driver.cpp 1. Retailltem class: The class should have three member variables • description (a string, represent the item's name. A name contains space) quantity (an int, represent how many current available) price (a double, item's price) Member Functions Constructor with default argument get Description getQuantity getPrice setDescription...

  • Assignment: Write a program in C++ that allows a customer to go on-line shopping. This is...

    Assignment: Write a program in C++ that allows a customer to go on-line shopping. This is a start-up venture and the stock of our on-line company is currently limited to the following items: A gift card to Home Depot, $50.00 A bottle of cologne (The One by Dolce Gabbana), $24.00 3. Akeychainwithabathtubornament,$14.00 4. Acard,$4.00 Although all items are in stock, the customer should only be made aware of the items that he or she can afford. In addition, demand for...

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
ADVERTISEMENT