answer.
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]
1 year 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]1 year 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
A painting company has determined that for every 115 square feet or wall space, one gallon of paint and eight hours of labor wil
Kay [80]

The program to calculate the total paint cost and other values is given below.

#include <iostream>

using namespace std;

int main() {  

 int rooms, laborChrg = 18;

 float paintChrg;

 float feetPerRoom[rooms];  

 float paintReq, laborHrs, paintCost, laborCost, totalCost, totalsqft=0;  

 cout<<"Enter the number of rooms to be painted "<<endl;

 cin>>rooms;  

 for(int i=0; i <= rooms; i++)

 {

 cout<<"Enter the square feet in room "<<endl;

 cin>>feetPerRoom[i];  

 // shortcut operator which is equivalent to totalsqft = totalsqft +     feetPerRoom[i];

 totalsqft += feetPerRoom[i];

 }  

 cout<<"Enter the cost of the paint per gallon "<<endl;

 cin>>paintChrg;  

 laborHrs = (totalsqft/115)*8;

 laborCost = laborHrs * laborChrg;  

 paintReq = totalsqft/115;

 paintCost = paintReq * paintChrg;  

 totalCost = laborCost + paintCost;  

 cout<<"The number of gallons of paint required "<<paintReq<<endl;

 cout<<"The hours of labor required "<<laborHrs<<endl;

 cout<<"The cost of the paint is "<<paintCost<<endl;

 cout<<"The labor charges are "<<laborHrs<<endl;

 cout<<"The Total cost of the paint job is "<<totalCost<<endl;  

 return 0;

}

Explanation:

The header files for input and output are imported.

#include <iostream>

using namespace std;

All the variables are taken as float except labour charge per hour and number of rooms.

The user is asked to input the number of rooms to be painted. An array holds the square feet in each room to be painted.

cout<<"Enter the number of rooms to be painted "<<endl;

cin>>rooms;  

for(int i=0; i <= rooms; i++)

{

cout<<"Enter the square feet in room "<<endl;

cin>>feetPerRoom[i];  

totalsqft += feetPerRoom[i];

}  

The above code asks for square feet in each room and calculates the total square feet to be painted simultaneously.

All the data to be displayed is calculated based on the values of labor charge per hour and gallons of paint needed, given in the question.

laborHrs = (totalsqft/115)*8;

laborCost = laborHrs * laborChrg;

paintReq = totalsqft/115;

paintCost = paintReq * paintChrg;

totalCost = laborCost + paintCost;

All the calculated values are displayed in the mentioned order.

7 0
2 years ago
Sarah works in a coffee house where she is responsible for keying in customer orders. A customer orders snacks and coffee, but l
Maru [420]

Answer:

Stack

Explanation:

Stack is a linear data structure that follows a particular order in the way an operation is done or sequence a job is completed.

It uses either LIFO ( Last In, First Out) which is also known as first come first served sequence or FILO (First In, Last Out) sequence.

There are several real life examples of which we can use the example of replacing the snack items Sarah brought for the customer.

If Sarah used the LIFO method, it means she replaced the snack items first ontop of the already existing snack items that's why there is a mismatch.

5 0
1 year ago
Read 2 more answers
In this project, you’ll create a security infrastructure design document for a fictional organization. The security services and
gogolik [260]

Answer and explanation:

Authentication:

authentication can be done by using the user id and password, by using social sign in  or by using the biometrics. Authentication means verify the user who they claim they are and to grant them access.  

Authentication works as follows:  

Prompting the user to enter the credentials.  

Send the credentials to the authentication server.  

Match the credentials.  

Authorize the user and grants the acces

External Website security:  

External Website security is important to protect the website from hackers, electronic thieves and to prevent security breach.  

Use of firewall.  

Implement the access control.  

Use of MVC (Model View Controller) to create different view for different type of user.  

Use of encryption.  

Use of SSL certificate.

Use of security plugins.  

Implement tools and techniques for backup and disaster recovery.  

Use of network monitoring team.  

Internal Website security:  

Use of authentication to identify the user identity.  

Use of authorization to provide different user with the specific privileges and access.  

Encrypt or hide sensitive web pages.  

By implementing IT policies.  

Educate the user about the website.  

Remote Access Solution:  

Remote access provides better security, cost efficiency, ease of management, and increased availability.  

Remote access can be deployed by using the RAS gateway (single tenant or multi-tenant):

VPN(Virtual private network), BGP(Border gateway protocol), hyper-V network can be used to provide the remote access.  

Remote access can be provided by simple configuration. Remote access involves enabling user, managing their access, protecting the assets, use of remote desktop protocol and managing server sessions, remoteApp and personal and pooled desktop.  

Firewall and Basic rules recommendations:  

Firewall is important for managing the traffic and providing external website security.  

Rules to prevent SQL injection and XSS.  

Allow only the specific type of traffic.  

Use access rules for IP security.  

Implement certain IT policies.  

Can implement their own rule.  

Wireless Security:  

Nowadays Wifi is being used in every organization and it prevents the network from malicious and unauthorized access.  

Wireless security can be provided by the use of encryption, decryption, authentication and authorization.  

VLAN configuration:  

VLAN are important for traffic filtering and providing the logical division of the network.  

VLAN can be configured for web interface and can provide web filtering.  

In the following manner VLAN can be configured for web interface:  

Switching => VLAN => Advanced => VLAN Membership  

Switching => VLAN > Advanced => Port PVID Configuration.  

VLAN web filtering:  

VLAN can be configured between router and firewall, router and gateway, router and switch and by doing so one can filter the web traffic that passes the network.  

Laptop Security Configuration:  

Use of password, VPN and registering the laptop by their MAC address will provide laptop security. Use of security tool for local machine is also a good option. Use of device level authentication by using local username and password is also a good idea.  

Application policy recommendations:  

Application policy includes use of cookies, social media integration, access control, generating notifications and implanting other organization and IT rules.  

Security and privacy policy recommendations:  

It includes the list of security methods to be implemented for traffic filtering, IP spoofing, user authentication and other specific policy for the website.  

Intrusion detection or prevention for systems containing customer data:  

IPS is implemented behind the firewall and it matches the incoming traffic against the security policies. It matches the signature and handles the intrusion if any and generates the log and alerts for the same.  

IDS goal is to identify malicious traffic before it can proceed further into the network. It generates alerts and notification so that the network monitoring team can look after the intrusion.  

Use of anomaly based detection and prevention system is the better choice.

6 0
2 years ago
A large software development company employs 100 computer programmers. Of them, 45 areproficient in Java, 30 in C, 20 in Python,
melisa1 [442]

Answer:

18, 13, 19

Explanation:

Number of computer programmers proficient only in Java = 45 - ( 1+1+6) = 37

Number of computer programmers proficient only in C++ = 30 - (6+1+5) = 18

Number of computer programmers proficient only in python = 20 - ( 1+1+5) = 13

Number of computer programmers are not proficient in any of these three languages = 100 - ( 37 + 18 + 13 + 1+ 1+ 5+ 6 ) = 100 - 81 = 19

4 0
2 years ago
Define the instance method inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids. Sample output for th
kow [346]

Answer:

This is the instance method inc_num_kids()

def inc_num_kids(self):

       self.num_kids += 1

Explanation:

The first line is the definition of function inc_num_kids() which has a parameter self. self is basically an instance of  class PersonInfo

self.num_kids += 1 this statement incremented the data member num_kids by 1. This means that the instance method inc_num_kids, using instance self, increments the value of num_kids data member by 1.

The complete program is as following:

class PersonInfo:  #class name PersonInfo

   def __init__(self):   #constructor of the class

       self.num_kids = 0  # data member num_kids

   def inc_num_kids(self):  # method inc_num_kids

       self.num_kids += 1  #increments num_kids by 1

person1 = PersonInfo()  #creates object person of class PersonInfo

print('Kids:', person1.num_kids)  # prints num_kids value before increment

person1.inc_num_kids()  #calls inc_num_kids method to increment num_kids

print('New baby, kids now:', person1.num_kids) #prints the value of num_kids after increment by inc_num_kids method

The person1 object first access the initial value of num_kids initialized by the constructor. So the first value of num_kids is 0. self.num_kids = 0  This statement assigns the value 0 to num_kids data member. Next the method inc_num_kids() using the object person1. Now when this method is called the value of data member num_kids is incremented to 1.

So previously the value was 0 which now increments by 1 and becomes 1. Last print statement displays this new value which is incremented by the inc_num_kids() method.

Hence the output is:

Kids: 0

New baby, kids now: 1

The program along with its output is attached.

7 0
2 years ago
Other questions:
  • Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user wil
    13·1 answer
  • Shirley was unsure about what career to go into. Her high school counselor suggested a personal assessment to point out Shirley’
    12·2 answers
  • What does a sticky CTA do?
    9·2 answers
  • Suppose that a 10-mb file is stored on a disk on the same track (track 50) in consecutive sectors. the disk arm is currently sit
    13·1 answer
  • Where does an MPLS label go in a PDU?
    13·1 answer
  • Define a new object in variable painter that has properties "name" storing "Vincent van Gogh"; "artworks" storing "The Starry Ni
    13·1 answer
  • Create an abstract Division class with fields for a company's division name and account number, and an abstract display() method
    14·1 answer
  • Write a function in the cell below that iterates through the words in file_contents, removes punctuation, and counts the frequen
    6·1 answer
  • For a class project, Jerome builds a simple circuit with a battery and three light bulbs. On his way to school, Jerome drops his
    9·1 answer
  • Exercise 4: Bring in program grades.cpp and grades.txt from the Lab 10 folder. Fill in the code in bold so that the data is prop
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!