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]
3 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]3 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
Which of the following statements is false? Data is lost when a local variable "goes out of scope." Data maintained in files is
Veronika [31]

Answer:

The false statement is "Data maintained in files is often called transient data".

Explanation:

In computer programming, transient data is a temporary storage to hold the value which is created within an application session. The transient data will be discarded at the end of the program. The transient data will be reset to its default value when running the program again.  In contrast, file is known as a persistent storage which will still hold data even after end of a program. This is the reason the statement "Data maintained in files is often called transient data" is contradictory and therefore is considered a false statement.

5 0
3 years ago
True or false? Opinionated websites can still be credible. A. True B. False
kumpel [21]
False. the information should not be biased in order to be creditable
5 0
4 years ago
Read 2 more answers
So i am taking to edhesive computer science course in my school, and i am confused on 1.6 code practice,
elixir [45]

I included my code in the picture below. Best of luck.

5 0
3 years ago
Fifty part-time students were asked how many courses they were taking this term. The (incomplete) results are shown below. Need
Ne4ueva [31]

Answer:

The answer for B is 10% and for C is 40%.

Explanation:

To get the percentage for B you take the the frequecy of students taking 2 courses (5) and multiply it by 100 then you divide it by whole number of students.

For C you do the after adding the number of students taking 1 or 2 courses (20).

5 0
3 years ago
When you select an object in the Visual Studio Designer, the object's size, color, text, and other characteristics are displayed
harina [27]

Answer:

the main window if that`s not correct sorry

Explanation:

3 0
3 years ago
Other questions:
  • Which is the main function of the arithmetic and logic unit (ALU)?
    5·2 answers
  • You are doing research for a current event report on smartphone technology. You do a web search for information that includes se
    5·2 answers
  • Why is RAM used for temporary storage!
    6·1 answer
  • How do you navigate multiple computer screen at one time?
    5·1 answer
  • ARP only permits address resolution to occur on a single network.could ARP send a request to a remote server in an IP datagram?w
    9·1 answer
  • Which of the following describes an iteration in a computer program?
    8·1 answer
  • Columns, margins and orientation can all be found on what tab?
    15·1 answer
  • Describing Report Viewing
    5·1 answer
  • the ratio of length, breadth and height of a room is 4:3:1. If 12m^3 air is contained in a room, find the length , breadth and h
    14·1 answer
  • Instruction: weird I know (~ ̄³ ̄)~
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!