1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
AleksandrR [38]
3 years ago
6

Write a program that asks for the number of units sold and computes the total cost of the purchase. Input validation: Make sure

the number of units is greater than 0. Use output (stream) manipulators: 2 digits after the decimal point g
Computers and Technology
1 answer:
stich3 [128]3 years ago
8 0

Answer:

Explanation:

The following code is written in C++, it asks the user for input on number of units sold and places it in a variable called units_sold. Then it asks for the package price and places that value in a variable called package_price. Finally it multiplies both values together into a variable called final_price and adjusts the decimals.

#include <iostream>

#include <iomanip>

using namespace std;

       int main()

       {

       // Variables

       int units_sold,

       final_price;

       // ask user for number of units sold

       cout << "\nEnter number of units sold: ";

       cin >> units_sold;

       

       //ask for Package price

       cout << "\nEnter Package Price: ";

       cin >> package_price;

       // Total amount before discount

       final_price = units_sold * package_price;

       cout << setprecision(2) << fixed;

       cout << endl;

       return 0;

       }

You might be interested in
True or false? Main Content (MC) may include links on the page.
nevsk [136]
True. 
You can create a permalink which is also a link inside your main content to link your topic to another similar or helpful topic. Sometimes we can put it in a way that we only pasted the entire link or just used a work then insert the link inside that work to redirect to another page

3 0
3 years ago
Software that communicates with the hardware and allows other programs to run. It is comprised of system software, or the fundam
alukav5142 [94]

Answer:An operating system, or "OS," is software that communicates with the hardware and allows other programs to run. It is comprised of system software, or the fundamental files your computer needs to boot up and function.

Explanation:

8 0
2 years ago
On which tab are import and export commands located in Access? A. Home B. Database Tools C. External Data D. Create
Ann [662]

Answer:

C. External Data

Explanation:

On the External Data tab, you can find import and export commands located in Access.

7 0
3 years ago
HIPAA protects which of the following kinds of data?
Gelneren [198K]
The answer is a i looked up the question and it says a
5 0
3 years ago
Read 2 more answers
Which of the following is NOT a characteristic developed by New Journalism?
krok68 [10]
Flashy page layouts
7 0
3 years ago
Other questions:
  • Which of the following is not an algorithm?
    8·1 answer
  • An _________ is a phrase formed from the first letters of words in a set phrase or series of words a. Acronymic sentence c. Basi
    7·2 answers
  • Someone is retiring next year. What would be an appropriate amount of risk to take their investments?
    8·2 answers
  • Write a method so that the main() code below can be replaced by the simpler code that calls method mphandminutestomiles(). origi
    14·2 answers
  • In this mode, your presentation will fill up the entire screen. Auto Default Standard Window
    6·2 answers
  • When creating a firewall exception, what is the difference between opening a port and allowing an application through?
    7·1 answer
  • To create a cover letter to send to potential employers along with a resume, what software program should you use ?
    6·2 answers
  • The Windows taskbar is generally found _____. at the top of the screen in the Start menu at the bottom of the screen at the righ
    14·2 answers
  • It refers to the story or events in which the film revolves.
    13·1 answer
  • What is e banking effects
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!