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
Nataly_w [17]
2 years ago
15

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.
Computers and Technology
1 answer:
UkoKoshka [18]2 years ago
4 0

Answer:

The program in Python is as follows:

qty = int(input("Quantity: "))

price = 100 * qty

if qty >1000:

    price = (100 - 0.10 * 100) * qty

print("Cost: "+str(price))

Explanation:

This prompts the user for the quantity

qty = int(input("Quantity: "))

This calculates the price or cost, without discount

price = 100 * qty

This checks if the quantity is greater than 1000

if qty >1000:

If yes, this calculates the price or cost, after discount

    price = (100 - 0.10 * 100) * qty

This prints the calculated cost

print("Cost: "+str(price))

You might be interested in
Hello my friends i am trying to reboot my i phone 4 but i could not i tried many ways can u help me
g100num [7]

Answer:

Launch iCloud.com in the web browser on your PC.

After the page opens, enter the credentials; username and password.

On the screen, after you login, you’ll see all iDevices you’ve associated...

Choose "Erase operation" for devices you can’t log inside.

or

Connect your iPhone to a computer. If your iPhone gets hung up on the Apple logo or a solid-color screen when forcing it to restart, you can try using your PC or Mac to repair it without losing data. Start by connecting the iPhone to the computer using its charging cable.

2

Open Finder (Mac) or iTunes (PC). If you're using Mac Catalina or later, click the two-toned face on the Dock to launch Finder. If you have Windows or an earlier version of macOS, open iTunes from the Start menu or Applications folder. Locate your iPhone. If you're using Finder, click your iPhone's name in the left panel under "Locations." If you're using iTunes, click the button with an iPhone icon near the top-left corner of the app (to the right of the drop-down menu)

Explanation:

8 0
3 years ago
An attacker tried to hack into the database of a reputed organization. The attacker inserted malicious code into the query of a
babunello [35]

a.) input attack is the correct answer

4 0
3 years ago
Leo noticed that attackers have breached his wireless network. They seem to have used a brute-force attack on the WiFi protected
kakasveta [241]

Answer:

It is called a WPS brutal force attack.

Explanation:

Wired and wireless networks are both susceptible to attacks. The wired network, the advantage as a cable connection, is more secure than wireless networks, but wireless network also have security measures like the wifi protected set up (WPS).

WPS is used to connect to a network without passphrase, but with a key combination or a PIN.

Brutal force attacks are used on WPS to forcefully generate the PIN, using a third party software.

3 0
3 years ago
Write a program that prints the Grade based on the given data. 95-100: A+ 90-94: A 80-89: B+ 70-79: B 60-69: C+ 50-59: C <49
mr Goodwill [35]

Answer:

The program to this question as follows:

Program:

score=int(input("Enter your percentage: ")) #input grade by user

#using conditional statement for match condition  

if 95<=score <= 100: #if value in between 95 to 100

   grade = 'A+' #assign grade

elif 90 <=score <= 94: #elif value in between 90 to 94

   grade = 'A' #assign grade

elif 80 <=score <= 89:  #elif value in between 80 to 89

   grade = 'B+' #assign grade

elif 70 <=score <= 79:  #elif value in between 70 to 79

   grade = 'B' #assign grade

elif 60 <=score <= 69:  #elif value in between 60 to 69

   grade = 'C+' #assign grade

elif 50 <=score <= 59:  #elif value in between 50 to 59

   grade = 'C' #assign grade

elif score<49 :  #elif value is less then 49

   grade = 'F' #assign grade

print (grade) #print grade

Output:

Enter your percentage: 50

C

 Explanation:

In the above python code, a variable "score" is defined, this variable is used for taking value from the user end. In the next step if-elif-else conditional statement is used, this statement is used when a group of statements is given in which one is true. The if block check score value is between 95-100 if this is true it will print A+.

In elif block if the above condition is not true, then this condition will execute, in this block, there are multiple elif block is used that can be described as follows:

  • In the first block, if the value in between 90-94. It will print A.
  • In the second block, if the value in between 80-89. It will print B+.
  • In the third block, if value in between 70-79. It will print B.
  • In the fourth block, if value in between 60-69. It will print C+.
  • In the fifth block, if value in between 50-59. It will print C.
  • In the last, if the value of the score is less then 49. It will print F.
8 0
3 years ago
explain why the database system would not allow a tuple to be inserted into the database through this view
Andrej [43]
For the view of Exercise 4.18, explain why the database system would not allow a tuple to be inserted into the database through this view.
For reference
For the database of Figure 4.12, write a query to find the ID of each employee with no manager. Note that an employee may simply have no manager listed or may have a null manager. Write your query using an outer join and then write it again using no outer join at all.
OUTER JOIN
select e.ID from employee e left outer join manages m on e.ID = m.ID
where m.manager_id is null;
NO OUTER
select e.ID from employee e where e.ID not in (select m.ID from manages m) or e.ID in (select m.ID from manages m where m.manager_id is null);
6 0
2 years ago
Other questions:
  • Yahoo! allows users to create personalized my yahoo! pages. users can add or delete a variety of information from their personal
    8·2 answers
  • One main advantage of CD-ROMs is that..
    7·1 answer
  • What kind of voltage do solar cells generate? Solar cells produce ______ voltage which is not usable by most household appliance
    15·1 answer
  • NullPointerException and ArithmeticException are both derived from which class?
    10·1 answer
  • Please help me ! All you do is just put it it all in your own words ! Please this is for my reported card!i don't know how to pu
    15·1 answer
  • In order to do a binary search on an array Group of answer choices you must first do a sequential search to be sure the element
    5·1 answer
  • A friend was just promoted to a new job that requires part-time travel, and he has also been promised a new laptop after his fir
    10·1 answer
  • What does the CFO of a company do
    14·1 answer
  • Which of these ia an example of gene flow?
    5·1 answer
  • Plzzz help i need this today :(
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!