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
nirvana33 [79]
3 years ago
6

Your car must have two red stoplights, seen from ______ feet in the daytime, that must come on when the foot brake is pressed.

Computers and Technology
1 answer:
Mkey [24]3 years ago
7 0

Answer:

the answer is 300 feet in the daytime

You might be interested in
What benefit does internet have​
Licemer1 [7]
Information can be transferred and passed way easier.
5 0
3 years ago
Write an expression that executes the loop while the user enters a number greater than or equal to 0.
LekaFEV [45]

Answer:

while (userNum >=0) {...}

Explanation:

In a <u>while loop</u>, <u>the loop is executed until the condition is false</u>.

Since the loop will execute while the user enters a number greater than or equal to 0 (and that number is declared as <em>userNum</em>), we need to check if <em>userNum</em> is greater than or equal to 0.

4 0
3 years ago
Write a function called count_occurrences that takes two strings. The second string should only be one character long. The funct
iVinArrow [24]

Answer:

Here is the Python function:

def count_occurrences (string1 , string2):  # method that takes two strings as parameter and returns how many times second string occurs in first

   count = 0  #counts number of occurrence of string2 in string1

   for word in string1:  #iterates through each word of the string1

       for character in word:  #iterates through each character of each word in string1

           if character == string2:  # checks if the character in string1 is equal to the character of string2

               count = count + 1  #adds 1 to the count of string2 in string1

   return count  #returns number of times the string2 occurs in string1

#in order to check the working of the function add the following lines to the code:    

first_str = input("Enter the first string: ")  #prompts user to enter first string

second_str = input("Enter the second string (one character long): ") #prompts user to enter second string which should be one character long

occurrence = count_occurrences(first_str,second_str)  #calls count_occurrences method by passing both strings to it

print(second_str,"occurs",occurrence,"times in",first_str) #prints how many times the second_str occurs in the first_str on output screen

Explanation:

The program is well explained in the comments added to each statement of the above code. I will explain the program with an example:

Suppose

string1 = "hello world"

string2 = 'l'

So the method count_occurrences() should return how many times l occurs in hello world.

count is used to count the number of occurrences of l in hello world. It is initialized to 0.

The first loop iterates through each word of string1. The first word of string1 is "hello"

The second loop iterates through each character/letter of each word. So the first letter of "hello" word is 'h'.

The if condition if character == string2: checks if the character is equal to string2 i.e. l.

character = "h"

string2 = "l"

The are not equal so the program moves to the next character of word hello which is e. The if condition again evaluates to false because e is not equal to l. So the program moves to the next character of word hello which is l.

This time the if condition evaluates to true because

character = "l"

string2 = "l"

character == string2

l == l

So the if part is executed which has the following statement:

count = count + 1

So the count is added to 1. count was 0 previously. Now

count = 1

Next the program moves to the next character of word hello which is l. This time the if condition evaluates to true because the character l matches with string2. So count is again incremented to 1. count = 2.

Next the program moves to the next character of word hello which is o. The if condition evaluates to false as o does not match with string2 i.e. l. So the count remains 2.

Next the first loop moves to the next word of the string1 = "world". The inner (second) for loop iterates through each character of "world" from "w" to "d" and checks if any character is equal to string2. Only one character is equal to string2 in "world". So count is incremented to 1. Hence count = 3

After the loop ends the statement return count returns the number of times string2 occurs in the string1. So the output is:

l occurs 3 times in hello world  

8 0
3 years ago
Chegg Suppose the heap is a full tree, size 2^n-1. what is the minimum number of steps to change a min heap to a max heap. Show
adoni [48]

Answer:

Explanation:

We start from the bottom-most and rightmost internal node of min Heap and then heapify all internal modes in the bottom-up way to build the Max heap.

To build a heap, the following algorithm is implemented for any input array.

BUILD-HEAP(A)

   heapsize := size(A)

   for i := floor(heapsize/2) downto 1

       do HEAPIFY(A, i)

   end for

Convert the given array of elements into an almost complete binary tree.

Ensure that the tree is a max heap.

Check that every non-leaf node contains a greater or equal value element than its child nodes.

If there exists any node that does not satisfy the ordering property of max heap, swap the elements.

Start checking from a non-leaf node with the highest index (bottom to top and right to left).

4 0
2 years ago
What is the QOS model?
Andre45 [30]

Answer:

Quality Of Service

Explanation:

Technology that manages data traffic to reduce packet loss, latency and jitter on the network. QoS controls and manages network resources by setting priorities for specific types of data on the network.

5 0
2 years ago
Other questions:
  • Which task manager tab provides details about how a program uses system resources?
    14·1 answer
  • Chandra, a student working on a group project, is trying to decide how to have the whole group suggest revisions for an essay. S
    10·1 answer
  • List and explain the error in the code
    14·1 answer
  • It is always better to run over and give more information when you are giving a presentation versus quitting on time.
    11·2 answers
  • ____ is the code of acceptable behaviors users should follow while on the internet; that is, it is the conduct expected of indiv
    10·1 answer
  • During the Cold War, defense contractors were required to shield sensitive computing systems and prevent electronic eavesdroppin
    14·1 answer
  • Several NEC® sections contain the requirement to size conductors and overcurrent devices at 100 percent of the noncontinuous loa
    15·1 answer
  • he wants to customize the operating system to meet his needs. what types of tools should he use, and what can he do with each?
    6·1 answer
  • Which of the following statements are TRUE about formatting images in HTML.
    13·1 answer
  • Please help with this question
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!