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
Why are digital calendars considered to be a convenient way to maintain a study schedule?
marysya [2.9K]
Hey there!

Let's assume that this question is referring to every digital calendar ever made. As in, even those made on devices without internet connectivity or any other fancy features that we utilize with many digital calendars today. 

If a planning device that came with a digital calendar didn't have internet connectivity, it wouldn't be able to be connected to the cloud. Back when these devices were around, it wasn't even plausible to store things like calendar events and contacts in what we know as the "cloud". Also, these devices probably had to be hardwired to a computer and new software had to be downloaded to them, so the updates weren't automatic. Archaic, right?

Also, consider the fact that even reputable websites/companies such as Google with Google Calendars or Apple with iCalendar will never go without their malfunctions or threats. Sometimes, these websites can be hacked and the data that they contain can be compromised, especially if they're stored on the cloud. Also, even though it's not realistic, Google or Apple could one day decide to completely get rid of their calendar programs altogether. So, this means that digital calendars are definitely able to be destroyed or lost. 

That just leaves "They can be used anywhere". This is true, even with those archaic devices specifically used for scheduling events and such. Nowadays, you have your phone and possibly a laptop on you at all times, which will likely have a calendar on it as a stock application. So, I think this is your answer. 

Hope this helped you out! :-)
3 0
4 years ago
Read 2 more answers
Like this post if u hate edhesive
Charra [1.4K]

Answer:

I hate Adhesive.

Explanation:

Adhesive is something of or relating to the molecular force that exists in the area of contact between unlike bodies and that acts to unite them. And that is just ridiculous.

5 0
3 years ago
Sharon is thinking about opening a bakery. She knows she wants to set her own hours, reduce her stress and make a profit. But sh
hodyreva [135]
Please provide complete details.
4 0
3 years ago
The Recycle Bin exists as a metaphor for throwing files away, but it also allows a user to retrieve and restore files. Once the
Karolina [17]

Answer:

a) INFO2 file

Explanation:

When a file is deleted and moved to the Recycle Bin generates its own records inside a INFO2 file. These files save data from the deleted file, so it can be analyzed later. The size of a INFO2 file is 800 bytes usually.

The data saved into this files is:

  • Original location of the removed file
  • Date and time when deleted
  • Physical size of the deleted file
6 0
3 years ago
Someone once observed that "the difference between roles and groups is that a user can shift into and out of roles, whereas that
mestny [16]

Answer:

All things considered newgrp has nothing to do with security jobs.  

newgrp sets the procedures bunch id which is in many frameworks are irrelevant. All gatherings are accessible. Gatherings are characterized as assortment of clients , bunch get to is conceded to documents dependent on the record gathering.  

Regularly (setgroups/getgroups ) all gatherings are in the process get to list.  

The authorization at a document or registry level has a 3 level arrangement of consents, for example, client proprietorship , bunch possession and others. All things considered the document authorization are a mix of read , compose and execute .we need both peruse and execute consent to run a program.  

A procedure may get to the document if a record has a place with the user(the proprietor of the document ) or if the gathering identifier coordinate on the gatherings in the clients bunches list. That entrance is constrained by the relating consents signals on the record.  

Gatherings have been over-burden with some "job" definitions. In any case, these are just over-burden and not a decent utilization of groups,the utilization of a gathering as a job was bolstered by the setgroup id banner , and by utilities like a sudo , where gathering name likewise coordinates a security control. It expect that the gathering name isn't utilized for documents yet once a client is in the gathering that client can apply the gathering to a record regardless of whether it isn't what the gathering was for.  

This over-burden use worked where frameworks didn't bolster genuine jobs. The over-burden utilize was only a work around.  

Linux has genuine job definition bolstered by SELinux models and can be applied to documents , clients , and forms.

7 0
4 years ago
Other questions:
  • Select the correct answer.
    8·1 answer
  • Having reviewed dod wireless stig (ver6, release 1), sarah learns she may only utilize secnet 54 and ______________ for transmit
    13·1 answer
  • How do i stream from my chromebook to my tv?
    8·1 answer
  • Which data table display compares report metrics to the website average?
    6·1 answer
  • When photographing wildlife, what type of lighting should you use?
    15·2 answers
  • Multiply the following two Tom's Tiny floating-point format numbers (8-bit: sign bit, 3-bit 2's complement exponent, 4-bit fract
    12·1 answer
  • What is payload?
    8·1 answer
  • A central issue of public sharing is:
    13·2 answers
  • Education leads to higher wages lower unemployment.* True or false
    5·1 answer
  • How to test someone elese internet speed from a distance
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!