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
kirill115 [55]
1 year ago
15

Def area(length, height):

Computers and Technology
1 answer:
Basile [38]1 year ago
6 0

Following are the <em><u>python complete code </u></em>to calculate the area:

Program Explanation:

  • Defining a method "area" that takes two variables "length, height" in the parameters.
  • Inside the method, a variable "area" is declared that calculates the area by multiplies "length and width".
  • After calculating the area a return keyword is used that returns its value.
  • Outside the method, a print method is declared that calls the area method by accepting value into its parameters.

Program:

def area(length, height):#defining a method area that takes two parameters "length, height"  

  area = length * height#defining a variable area that calculates the area by multiplies length and width  

  return area#using return keyword that returns area value  

print(area(9,8))#using a print method that calls area method by accepting the value  

Output:

Please find the attached file.

  • <u>In this code, the </u><u>method call</u><u> is missing therefore, the final answer is</u> "Option A".

Learn more:

brainly.com/question/24819022

You might be interested in
1. Explain the distinction between interpretation and compilation. What are the comparative advantages and disadvantages of the
serious [3.7K]

Answer:

11: Compiler translates a high level source program into a target equivalent (machine language).

An interpreter implements a virtual machine, the high-level programming language of which is the "machine language." The interpreter reads statements more or less one at a time in that language, and executes them as they go along.

12: One could also consider Java either. A compiler (complicated translator) can create code, which is then executed by a complicated virtual machine (interpreter)

13: A preprocessor is an initial translator which removes comments and white space, and group characters together into tokens such as keywords, identifiers, numbers, and symbols, as well as simple syntactic structure analyses. A compiler uses in-depth analysis and nontrivial transformation.

14: C++ implementations based on the early AT&T compiler created an intermediate program in C rather than assembly language

15: Stack-based language, similar to modern Java compiler byte code

16: A method in which a simple interpreter implementation evolves into building more complex versions until the compiler is built.

17: A compiler which translates byte code into machine language immediately prior to each program execution.

18: Lisp and Prolog

19: TEX and TROFF are one of such compilers that translate high-level document descriptions into laser printer or phototypesetter commands. Query language processors for database systems are also compilers that translate languages such as SQL into primitive file operations.

21: without havin to call multiple tools with command-line tools, You can write an entire program in an IDE.

8 0
3 years ago
You are setting up your Windows computer to connect to the Internet and notice that when you type www.microsoft, the browser doe
Harrizon [31]

Answer:

Check your DNS settings

Explanation:

Different errors may occur when setting up your computer to connect to the internet, one of which is described in the question above.

The DNS (Domain Name System) is responsible for redirecting domain names to their physical IP address. Instead of remembering every IP address of sites you visit frequently, domain names are used for easy remembrance, the DNS makes the matching of domain names to IP addresses possible.

To change your DNS setting follow these steps:

  1. Click settings from your start menu
  2. Click on Network and Internet
  3. Look to the bottom of the main page and click on "Network and Sharing Center"
  4. On the left tab, click "Change adapter settings"
  5. Right Click on the current network you are using and select properties
  6. Left-click on the "Internet Protocol Version 4 (TCP/IPv4) and click on properties.
  7. Check to see if "Obtain DNS server address automatically" is selected, if it is selected,
  8. Click on the radio button under it "Use the following DNS server address"
  9. Enter the DNS address you want to use
  10. Click Ok and close the window.

The problem should be resolved.

4 0
3 years ago
A computer retail store has 15 personal computers in stock. A buyer wants to purchase 3 of them. Unknown to either the retail st
Dima020 [189]

Answer:

a. 1365 ways

b. Probability = 0.4096

c. Probability = 0.5904

Explanation:

Given

PCs = 15

Purchase = 3

Solving (a): Ways to select 4 computers out of 15, we make use of Combination formula as follows;

^nC_r = \frac{n!}{(n-r)!r!}

Where n = 15\ and\ r = 4

^{15}C_4 = \frac{15!}{(15-4)!4!}

^{15}C_4 = \frac{15!}{11!4!}

^{15}C_4 = \frac{15 * 14 * 13 * 12 * 11!}{11! * 4 * 3 * 2 * 1}

^{15}C_4 = \frac{15 * 14 * 13 * 12}{4 * 3 * 2 * 1}

^{15}C_4 = \frac{32760}{24}

^{15}C_4 = 1365

<em>Hence, there are 1365 ways </em>

Solving (b): The probability that exactly 1 will be defective (from the selected 4)

First, we calculate the probability of a PC being defective (p) and probability of a PC not being defective (q)

<em>From the given parameters; 3 out of 15 is detective;</em>

So;

p = 3/15

p = 0.2

q = 1 - p

q = 1 - 0.2

q = 0.8

Solving further using binomial;

(p + q)^n = p^n + ^nC_1p^{n-1}q + ^nC_2p^{n-2}q^2 + .....+q^n

Where n = 4

For the probability that exactly 1 out of 4 will be defective, we make use of

Probability =  ^nC_3pq^3

Substitute 4 for n, 0.2 for p and 0.8 for q

Probability =  ^4C_3 * 0.2 * 0.8^3

Probability =  \frac{4!}{3!1!} * 0.2 * 0.8^3

Probability = 4 * 0.2 * 0.8^3

Probability = 0.4096

Solving (c): Probability that at least one is defective;

In probability, opposite probability sums to 1;

Hence;

<em>Probability that at least one is defective + Probability that at none is defective = 1</em>

Probability that none is defective is calculated as thus;

Probability =  q^n

Substitute 4 for n and 0.8 for q

Probability =  0.8^4

Probability = 0.4096

Substitute 0.4096 for Probability that at none is defective

Probability that at least one is defective + 0.4096= 1

Collect Like Terms

Probability = 1 - 0.4096

Probability = 0.5904

8 0
2 years ago
Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp
kondaur [170]

in c++

...

for(auto& el:hourlyTemp){

std::cout<<el<<", ";

}

...

This is called Range-based loop or for each loop

5 0
3 years ago
Which is an example of a Boolean operator that evaluates as TRUE?
ladessa [460]

The expression NOT (3+2=7) evaluates as TRUE because is is NOT the case that 3+2=7.

Let me know if you have any questions.

4 0
3 years ago
Other questions:
  • Categorize the following relationships into generalization, aggregation, or association. Beware, there may be n-ary associations
    14·1 answer
  • What is the most credible website or webpage you have ever visited?Why is it so credible? Describe some of the qualities that ma
    11·1 answer
  • Suppose you wanted to run a web server or ftp server from your home. what type of ip address would you want?​
    6·1 answer
  • Write only in C, not C++.
    14·1 answer
  • Which of the following is considered a basic task in the context of computer operations? a. Connecting to the Internet b. Natura
    6·1 answer
  • The signature area in a cover letter includes the sender's first and last name, followed by his/her job title (if applicable). *
    13·1 answer
  • what social media application that affect our day to day activities, and how did it improve our skill
    9·1 answer
  • 9. These particular machines can be decentralized.
    9·1 answer
  • Determine whether the compound condition is True or False.
    14·1 answer
  • China sends a computer virus that shuts down telephone service in the United States. In retaliation, the United States hacks int
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!