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
algol [13]
3 years ago
5

A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity suppose, one unit wi

ll cost 100. Judge and print total cost for user. Plz give answer in C++.
Computers and Technology
1 answer:
Mamont248 [21]3 years ago
4 0

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int qty;

   float discount = 0;

   cout<<"Quantity: ";

   cin>>qty;

   int cost = qty * 100;

i f (cost > 1000) {        discount=cost * 0.10;        }

   cout<<"Cost: "<<cost - discount;

   return 0;

}

Explanation:

This declares the quantity as integer

   int qty;

This declares and initializes discount to 0

   float discount = 0;

This prompts the user for quantity

   cout<<"Quantity: ";

This gets input for quantity

   cin>>qty;

This calculates the cost

   int cost = qty * 100;

If cost is above 1000, a discount of 10% is calculated

i f (cost > 1000) {        discount=cost * 0.10;        }

This prints the cost

   cout<<"Cost: "<<cost - discount;

You might be interested in
Sometimes we write similar letters to different people. For example, you might write to your parents to tell them about your cla
OleMash [197]

?

?????????????????????

4 0
3 years ago
In general, what is the leftmost point of a circle with radius r centered at (x,y)?
Semmy [17]

The answer is (x-r, y).

5 0
3 years ago
If a company gave you a free version of their software and encouraged you to try and improve it and share it with the only commu
dimulka [17.4K]

Answer:

Explanation:

crm

8 0
2 years ago
Can anyone suggest me any good complete isekai anime..​
Fofino [41]
I suggest you watch hentaaii my boyy


8 0
2 years ago
Read 2 more answers
NEED HELP RIGHT NOW!!! Which of the following is the definition of a privacy policy? * 5 points - A legal document that an app o
Marina86 [1]

Answer:

A legal document that an app or a website must provide to describe the rules the company and users must obey when they use the app.

6 0
3 years ago
Other questions:
  • Python
    14·1 answer
  • . Suppose that name is a variable of type string. Write the input statement to read and store the input Brenda Clinton in name
    5·1 answer
  • A ________ is a self-contained program that spreads through a computer network by exploiting security holes in the computers con
    9·1 answer
  • __________ is the order of arrangement of files and folders.
    6·1 answer
  • Suppose you are choosing between four different desktop computers: one is Apple MacIntosh and the other three are PC-compatible
    15·1 answer
  • Anyone down to play gta later i play on ps4?
    15·2 answers
  • In confirmatory visualization Group of answer choices Users expect to see a certain pattern in the data Users confirm the qualit
    9·1 answer
  • The most important hardware device for connecting supercomputers over a wide area
    10·1 answer
  • Fill in the blank with the correct term.
    10·2 answers
  • What command will prevent all unencrypted passwords from displaying in plain text in a configuration file?.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!