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
Ivahew [28]
2 years ago
12

Write a program to solve the selection problem. Let k = N/2. Draw a table showing the running time of your program for various v

alues of N.
Computers and Technology
1 answer:
Brums [2.3K]2 years ago
4 0
So here is the code in Python:

n = 0.00 #this is a float because there are some numbers that are decimals.

while n < 20: #n which is 0.00 and while it is lower than 20 if runs the code below
n = n + 1 #it will add 1 to n everything it runs the code.
k = n / 2 #it will divide whatever n is everytime by 2
print(str(n) + '/2: ') # it's printing the number it's on
print(k) # prints the answer for the n.

You can change n to add by any, make n any num instead of 0.00 and you can change the while condition from n < 20 to any other logical statement. If you want to get creative you can take 2 inputs for numbers and make one of them the starting number and other one is the ending number. Also make sure to make n a number lower than you starting point because if you set n as your starting point then it will skip it.

You might be interested in
How do the World Wide Web and the Internet work together?
Firlakuza [10]

Answer:

Explanation:

The relationship between the World Wide Web and the Internet is that the Internet is a collection of connected computers through gateways by which the information that is stored in databases and on servers is transferred from one computer to another and the World Wide Web is the software that is used to retrieve the information requested by the users.  The World Wide Web (which we call the Web because we’re lazy typists) lives “on top of” the Internet. The Internet’s network is at the core of the Web, and the Web is like an attractive parasite that requires the Net for survival (dummies.com, 2010).  The Web page that are accessible on the web usually contain hypertext links and are sometimes called links. These links connect to other pages that are store on the same or even a different server; these servers can be in any location throughout the World.  This system of interlinked documents is known as hypertext (Dummies.com, 2010).

Links can create connections that let you go directly to related information. These invisible connections between pages are like the threads of a spider web — as you click from Web page to Web page, you can envision the Web created by the links. What’s so remarkable about the Web is that it connects pieces of information from all around the planet, on different computers and in different databases (Dummies.com, 2010).  Every Web page has a name attached to it so that browsers, and you, can find it. The name of this naming convention: URL, or Uniform Resource Locator. Every Web page has a URL, a series of characters that begins with http://. (Pronounce each letter, “U-R-L” — no one says “earl.”), (Dummies.com, 2010).  The Internet is a world wide network of computers that are connected (networked) and are using the communication method called TCP/IP. The Internet was named ARPANET in 1969 by the Advanced Research Projects Agency of the U.S. Department of Defence with just four computers connected together (Comentum.com, 2010).  The Internet, sometimes called simply “the Net,” is a worldwide system of computer networks – a network of networks in which users at any one computer can, if they have permission, get information from any other computer (SearchWinDevelopment.com, 2010).  Computers are connected to the Internet via modems and gateways. Some computers are used as servers which are continuously connected to the Internet and used to store web pages; these computers are usually referred to as servers. A house hold computer is primarily used by ordinary people to search for information on the web is usually known as a client. The request for information or search result is passed by the browser on the client to the server that contains the pages which have the relevant information in them via the net. The request passes through the modem then along the net to the correct server, the server then serves up the correct page, which is then sent back to client computer and presented to the user through the browser.

5 0
3 years ago
What type of video games do you prefer buying?
Tamiku [17]
Mine is minecraft maybe
6 0
3 years ago
Var name = prompt("Enter the name to print on your tee-shirt");
Vinil7 [7]

Willy Shakespeare has 17 characters. It's higher than 12,so the output will be Too long. Enter a name with fewer than 12 characters.

Letter a.

3 0
3 years ago
________ states that the value of a network is equal to the square of the number of users connected to it.
Juliette [100K]

Answer:

This is known as the Metcalfe's Law

Explanation:

In 1980, Metcalfe's law was first presented, not considering users but the communication among compatible devices (e.g. telephone, fax machines and so on). It was after the globalization of the internet that the law got introduced to users and networks.

A demonstration of the law can be seen in fax machines, one fax machine is purposeless, however, the interconnection of multiple fax machines on the network increases the value of every fax machine because the number of the users of the fax machines increases. Similarly, the more the users of a particular service, the more relevant the service becomes.

8 0
3 years ago
Read 2 more answers
When the wires are connected to the terminals of the battery, what causes electric current in the circuit?
Anastaziya [24]

Answer: The battery provides a voltage between terminals. The electric field set up in a wire connected to the battery terminals causes the current to flow, which occurs when the current has a complete conducting path from one terminal of the batter to the other. This is called a circuit.

Explanation:

4 0
3 years ago
Other questions:
  • Which part of the cpu stores instructions for high speed access or processing
    14·1 answer
  • You open a web page and log into your email. The traffic travels over many routers. What protocol will the routers use to determ
    6·1 answer
  • Which actions did Sheila have to take to make the changes observed? Check all that apply.
    9·1 answer
  • Match each career with the education required for each job
    12·1 answer
  • 100 Base-T: Group of answer choices
    11·1 answer
  • Please respond not with answer but with comment.
    12·1 answer
  • What is a case in programming​
    12·1 answer
  • Which TWO of these correctly describe a Trojan horse malware?
    11·2 answers
  • Animals living in burrows under the ground is an interaction between the biosphere and the
    11·1 answer
  • Name and define (or list the set that defines) three of the four common data types in programming
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!