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]
2 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]2 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
Which feature is used to help identify the appropriate content for particular form fields?
Alika [10]

Answer:

The correct option is;

Content controls

Explanation:

Content controls are customizable controls that can be added to forms, templates and document that enable users to identify or preview the expected data that fills a given form field

Content controls can be in the form of instructional text that give users an idea of the expected format of the content of a given form field, such that the text disappears as soon as the user starts typing in their own text.

6 0
3 years ago
Select the correct answer. Marie uses a browser to visit a blog. How is the blog uniquely identified? A. web page B. website C.
damaskus [11]

Answer:

I belive the answer is E

Explanation:

8 0
2 years ago
For your biology class, you have taken a number of measurements for A plant growth experiment. you wish to create a chart that s
Natasha2012 [34]
The answer is B, calc or excel
4 0
2 years ago
A vending machine that serves coffee pours a varying
babunello [35]
Is that the whole question? or
8 0
2 years ago
Kendra, a user, would like to share her serial printer that has no networking connectivity with the other users in her small off
alexira [117]

Answer:

B. Enable print sharing on the computer.

Explanation:

Enabling print sharing on the computer would be the best choice for providing this functionality with the least effort and cost to the user since it has no networking connectivity.

7 0
3 years ago
Other questions:
  • Into which of these files would you paste copied information to create an integrated document? A. Mailing list B. Source C. Data
    13·2 answers
  • he Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5. Write an application named Hu
    10·2 answers
  • Mr. Mathis asked his students to add a comment to a cell the students recorded the steps they followed in a chart. Which student
    12·2 answers
  • You recently purchased a new laptop for home. You want to ensure that you are safe from malware. You should install a personal _
    10·1 answer
  • Software that protects confidentiality by screening outgoing documents to identify and block transmission of sensitive informati
    12·1 answer
  • Compressing a file is also called
    9·2 answers
  • Which of the following sentences is accurate? a. PDF stands for "Proofreading Direct Files." b. PDF files cannot be edited. c. B
    9·1 answer
  • A technician has been asked to upgrade a processor and needs to do some research. The computer is just a couple of years old. Wh
    13·1 answer
  • Picking up sound over a great distance while making it seem to come from close up.
    11·1 answer
  • Una laptop agarra mas internet que una computadora de escritorio?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!