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
Given the code below, which three statements can be used to create the controller variable?
Black_prince [1.1K]

Answer:

B, D, E

Explanation:

B. Apexpages.standardsetcontroller controller=new

apexpages.standardsetcontroller(database.getquerylocator('select id from account'));

D. Apexpages.standardsetcontroller controller = new

apexpages.standardsetcontroller (database.getquerylocator([select id

from account])); and

E. Apexpages.standardsetcontroller controller = new

apexpages.standardsetcontroller (database.query('select id from

account'));

7 0
3 years ago
How is digital footprint created ?
dalvyx [7]

Answer:

by simply just logging on and using the internet.

Explanation:

4 0
3 years ago
What medical equipment do they have in Jr. high, To help save peoples lives?
lawyer [7]

Vital signs monitors, Electronic Medical Records (EMR), and Medication Management Systems.

5 0
3 years ago
Lynn has created a quarterly sales report using a word processor. The document is confidential, and Lynn wants to secure it with
sweet-ann [11.9K]
Stop cheating



It’s b
3 0
3 years ago
In an LAN domain, _______________ is similar to a hub but can filter traffic, a ______________ connects LANs, or a LAN and a WAN
Alex17521 [72]

Answer: Switch, router, firewall

Explanation:

The function of the switch is to distribute the network to different networks similar in functioning to that of the hub but it performs filtering of the traffic present in the network using various traffic filtering algorithms.

The router whose main function is to route packets across the network is also used to connect between LANs and between LAN and a WAN.

The firewall is typically installed on systems or in servers or in routers with it most important function to filtering the traffic and minimize the packet delivery delay in LANs.

4 0
3 years ago
Other questions:
  • To view the results of a saved query, right-click the query in the Navigation Pane and click ____ on the shortcut menu.
    7·1 answer
  • Which button do you use to put data in a specific order A.Insert
    6·2 answers
  • A is the smallest unit of application data recognized bysystem software.
    12·1 answer
  • Now imagine that we have a list of 5 employees who have each worked 45, 15, 63, 23, and 39 hours. We'll fix rate_of_pay at 10. P
    10·1 answer
  • DSSS uses a chipping code to encode redundant data into the modulated signal. Which two of the following are examples of chippin
    12·1 answer
  • Question 1
    14·2 answers
  • What Is The Oldest Known Analog Computer In The World?
    14·1 answer
  • RAM that can be changed. True or False
    9·2 answers
  • 4.3 Code Practice<br> edhisve
    13·1 answer
  • Treating others with respect, even when they're impolite, is considered
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!