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
While reading difficult content, you should always start witha.Surveying the chapterc.Reading the chapterb.Defining vocabulary w
katrin [286]
When reading difficult content you should- Survey the chapter.

Surveying the chapter allows you to better interpret the literary text and therefore be able to answer the following questions or summarize. 

Hope I helped,
-CSX :)
5 0
3 years ago
Quick time and flash are two examples of what product
zheka24 [161]

there apps .........

8 0
3 years ago
The primary stream fed by tributaries within a dendritic drainage network is termed a ________ stream
a_sh-v [17]
<span>TRUNK. In a dendritic system, there are many smaller rivers or streams (the "twigs" of the tree), which are then merged into the tributaries of the main river (the branches and the trunk of the tree, respectively). They tend to develop in V-shaped valleys</span>
6 0
4 years ago
"What technology will examine the current state of a network device before allowing it can to connect to the network and force a
slava [35]

Answer:

a network access control

3 0
3 years ago
What does the use of color and images on a blog refer to?
serious [3.7K]
I think marketing and branding. i dont think this is 100% correct
8 0
3 years ago
Read 2 more answers
Other questions:
  • What standard linux utility is used to install and configure software on centos operating systems?
    8·1 answer
  • In a process called _____, excel continually reviews the workbook for errors in formulas as you create or manipulate it.
    13·1 answer
  • Which port-authentication network access control standard forces devices to go through a full authentication, authorization, and
    13·1 answer
  • Will the Python code below print something? And will it terminate?
    9·1 answer
  • Routing connects different network segments and decides where __________are sent to
    7·1 answer
  • I am doing 7th grade coding 3.02 assignment can anybody help me it says bad input on line 3 and this is what it is can someone h
    6·1 answer
  • Electronic mail is best used to:
    5·2 answers
  • after entering backstage view, and clicking account settings, what are the steps for creating a delegate for an outlook folder
    6·1 answer
  • Your company is building a new architecture to support its data-centric business focus. You are responsible for setting up the n
    15·1 answer
  • What is installing?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!