Write function that ask for input from a user. Use this input as input for the countdown function that we wrote using the while loop. If the user types 'end', the program exits, otherwise it keeps going.

Answers

Answer 1

Answer:

Written in Python:

def myfunction():

     userinput = input("User input: ")

     while(userinput != "end"):

           countdown(userinput)

           userinput = input("User input: ")

Explanation:

This line defines the function

def myfunction():

           This line prompts user for user input

           userinput = input("User input: ")

           The following while loop checks if userinput is not "end". It continues execution until user input "end"

           while(userinput != "end"):

                       countdown(userinput) If yes, the input is passed to the countdown function for execution

                       This line prompts user for another user input

                       userinput = input("User input: ")

Please note the above code segment assumes that countdown() function has already been written and defined


Related Questions

Determine the number of character comparisons made by the brute-force algorithm in searching for the pattern GANDHI in the text
THERE_IS_MORE_TO_LIFE_THAN_INCREASING_ITS_SPEED
(Assume that the length of the text-it is 47 characters long- is known before the search starts).

Answers

Answer:

Total number of character comparison = 43

Explanation:

Using the Brute force algorithm

The string of n characters is known as text, and the string of m characters is known as the pattern.

From the given information:

The text (n)=THERE_IS_MORE_TO_LIFE_THAN_INCREASING_ITS_SPEED

The pattern (m) = GANDHI

The total no of characters that we have in the text = 47

The total number of characters in pattern = 6

For a brute force algorithm;

Since; the first character of the pattern does not exist in the text, then the number of trials made can be attempted can be expressed as = n – m + 1

= 47 – 6 + 1

= 47 – 5

= 42

Thus; the algorithm will attempt the trial 42 times.

Now, for loop in the algorithm to run 42 times, the G in the pattern will have to align against the for T in the text, and in the last case, it will be aligned against the last space.

On each attempted trial, the algorithm will make one unsuccessful comparison.

However, at the trial at which the G in the pattern Is aligned with the G in the text, there will be two successful comparisons.

Hence, we can calculate the total number of character comparison as follows:

Total number of character comparison = [tex]\mathbf{\bigg ( ( 42 - (no. \ of \ failed \ comparison) ) \times 1 + (1 \times ( Two \ successful \ comparisons) ) \bigg ) }[/tex]

Total number of character comparison = ( (( 42 – 1) × 1 ) + ( 1 × 2) )

Total number of character comparison = 41 + 2

Total number of character comparison = 43

PLEASE ANSWER QUICK
How can improving one’s reasoning skills also improve one’s performance on the job?
A. If one can improve one’s reasoning, one can also improve one’s physical fitness and athletic performance.
B. If one can improve one’s reasoning, one can perform anything.
C. High-performing workers always work reasonable schedules.
D. High-performing workers are able to analyze sophisticated streams of data and solve complex problems.

Answers

Answer: C

Explanation:

C high performance workers always work

Which of these four things should not be included in a problem statement?

a
Creating a sketch
b
planning the process
c
Identify and validate
d
Understanding Criteria

Answers

I’m pretty sure it’s A. Creating a sketch.

True or false: Simultaneous multithreading (SMT) uses threads to improve resource utilization of a dynamically scheduled, out-of-order processor.

Answers

Answer:

True

Explanation:

Simultaneous multithreading or otherwise called, SMT that is a technique that us used for improving the total and overall efficiency of superscalar CPUs with hardware multithreading. Simultaneous Multithreading allows different types of independent threads, ability to execute and then eventually take optimum and much better use of the resources that is provided by modern processor architectures. Multithreading can not only allow multiple threads to be executed simultaneously in a single CPU core, it also allows multiple tasks some of which are different page tables, different I/O permissions, and others to be executed

The 1950s brought the television and interest in using television as a teaching device. In 1952, the _____________________________ decided to set aside 242 educational channels.

Answers

Answer:

Federal Communications Commission

Explanation:

The 1950s brought the television and interest in using television as a teaching device. In 1952, the Federal Communications Commission decided to set aside 242 educational channels.

The Federal Communication Commission were in charge of determining which type of programs were to be aired based in different factors such as current state of the nation etc.

A computer has _____IP address(es).

a) many
b) one

Answers

Answer:

one................

Answer:

B) one

Explanation:

nder a Huffman encoding ofnsymbols with frequenciesf1, f2, . . . , fn, what is the longest a codewordcould possibly be

Answers

Answer:

The longest codeword that could possibly be for "n" symbol is n-1 bits.

Explanation:

From the given information:

Suppose we are to consider a set of frequencies [tex]\mathtt{f_1,f_2,f_3 ...,f_n}[/tex], for which f is a symbol for the length n. Therefore, the longest codeword that could possibly be for "n" symbol is n-1 bits.

However, during the encoding for "n" in conjunction with n-2, then the possibilities for n are; [tex]\mathtt{\dfrac{1}{2}, \dfrac{1}{4}, ... \dfrac{1}{2^{n-2}}}[/tex]

We can conclude that the longest codeword that could possibly be for "n" symbol is n-1 bits.

Compute the decimal representation for each of the following numbers.

a. (1100110)2
b. (346)7
c. (1024)8
d. (3B2)16
e. (AF72)16
f. (120121)3
g. (A22)11

Answers

Answer:

[tex](1100110)_2= 102_{10[/tex]

[tex](346)_7= 181_{10[/tex]

[tex](1024)_8 = 532_{10[/tex]

[tex](3B2)_{16} = 946_{10[/tex]

[tex](AF72)_{16}= 44914_{10[/tex]

[tex](120121)_3= 421_{10[/tex]

[tex](A22)_{11} = 1234_{10}[/tex]

Explanation:

Required

Convert to decimal

To do this we get the position of individual digits (starting from the rightmost digit).

Then each digit is multiplied by the base raise to power its position.

Lastly, we sum the results of the products.

Following the above steps, we have:

[tex]a.\ (1100110)_2[/tex]

[tex]= 1 * 2^6 + 1 * 2^5 + 0 * 2^4 + 0 * 2^3 + 1 * 2^2 + 1 * 2^1 + 0 * 2^0[/tex]

[tex]= 1 * 64 + 1 * 32 + 0 * 16 + 0 * 8 + 1 * 4 + 1 * 2 + 0 * 1[/tex]

[tex]= 64 + 32 + 0 + 0 + 4 + 2 + 0[/tex]

[tex]= 102[/tex]

Hence:

[tex](1100110)_2= 102_{10[/tex]

[tex]b.\ (346)_7[/tex]

[tex]= 3 * 7^2 + 4*7^1 + 6 * 7^0[/tex]

[tex]= 3 * 49 + 4*7 + 6 * 1[/tex]

[tex]= 147 + 28 + 6[/tex]

[tex]= 181[/tex]

Hence:

[tex](346)_7= 181_{10[/tex]

[tex]c.\ (1024)_8[/tex]

[tex]= 1 * 8^3 + 0 * 8^2 + 2 * 8^1 + 4 * 8^0[/tex]

[tex]= 1 * 512+ 0 * 64 + 2 * 8 + 4 * 1[/tex]

[tex]= 512+ 0 + 16 + 4[/tex]

[tex]= 532[/tex]

Hence:

[tex](1024)_8 = 532_{10[/tex]

[tex]d.\ (3B2)_{16[/tex]

[tex]= 3 * 16^2 + B * 16^1 + 2 * 16^0[/tex]

[tex]= 3 * 256 + B * 16 + 2 * 1[/tex]

B represents 11, so we have:

[tex]= 3 * 256 + 11 * 16 + 2 * 1[/tex]

[tex]= 768 + 176 + 2[/tex]

[tex]= 946[/tex]

Hence:

[tex](3B2)_{16} = 946_{10[/tex]

[tex]e.\ (AF72)_{16[/tex]

[tex]= A * 16^3 + F * 16^2 + 7 * 16^1 + 2 * 16^0[/tex]

[tex]= A * 4096 + F * 256 + 7 * 16 + 2 * 1[/tex]

A represents 10 and F, 15; So, we have:

[tex]= 10 * 4096 + 15 * 256 + 7 * 16 + 2 * 1[/tex]

[tex]= 40960 + 3840 + 112 + 2[/tex]

[tex]= 44914[/tex]

Hence:

[tex](AF72)_{16}= 44914_{10[/tex]

[tex]f.\ (120121)_3[/tex]

[tex]= 1 * 3^5 + 2*3^4 + 0*3^3 + 1*3^2 + 2*3^1 + 1*3^0[/tex]

[tex]= 1 * 243 + 2*81 + 0*27 + 1*9 + 2*3 + 1*1[/tex]

[tex]= 243 + 162 + 0 + 9 + 6 + 1[/tex]

[tex]= 421[/tex]

Hence:

[tex](120121)_3= 421_{10[/tex]

[tex]g.\ (A22)_{11[/tex]

[tex]= A * 11^2 + 2 * 11^1 + 2 * 11^0[/tex]

[tex]= A * 121 + 2 * 11 + 2 * 1[/tex]

A represents 10, so we have:

[tex]= 10 * 121 + 2 * 11 + 2 * 1[/tex]

[tex]= 1210 + 22+ 2[/tex]

[tex]= 1234[/tex]

Hence:

[tex](A22)_{11} = 1234_{10}[/tex]

PLzzzzzz help me!! I will mark brainiest to the one who answers it right!!
Answer it quickly!!

Write a pseudo code for an algorithm to center a title in a word processor.

Answers

Answer: abstract algebra

Explanation: start with the algorithm you are using, and phrase it using words that are easily transcribed into computer instructions.

Indent when you are enclosing instructions within a loop or a conditional clause. ...

Avoid words associated with a certain kind of computer language.

Answer:

(Answers may vary.)

Open the document using word processing software.

In the document, select the title that you want to center. The selected word is highlighted.

On the Menu bar, select the Format tab.

In the Format menu, select Paragraph.

The Paragraph dialog box opens with two sub tabs: Indents and Spacing, and Page and Line Breaks. The first tab is selected by default.

Adjust the indentation for the left and right side. Ensure that both sides are equal.

Preview the change at the bottom of the dialog box.

Click OK if correct, otherwise click Cancel to undo changes.

If you clicked OK, the title is now centered.

If you clicked Cancel, the title will remain as it is.

Explanation:

I took the unit activity

Which choices correctly describe an Else
statement? Check all that apply.
a conditional statement that will show
different information if the answer to the If
statement is true
a conditional statement that will show
different information after the If statement
answer is false
a statement that contains the code to be
executed when the If value is false or zero
a conditional statement that runs a piece of
code when all program statements are true

Answers

Answer: B C

Explanation:

Answer:B,C,D

Explanation:

One of the primary principles of the Rapid Application Development methodology is early prototyping of the _______ in the development cycle

Answers

Answer:

Software Applications

Explanation:

Rapid Application Development (RAD) also is an agile project management strategy used in the development of software. RAD is also referred to as Rapid Application Building (RAB).

Its greatest advantage is that it reduces the time taken to churn out a program and this is why a lot of developers are now adopting it.

This is made possible by reducing the amount of time and effort spent on planning and increasing the amount of energy spent on creating prototypes.

Other merits of this methodology are:

It reduces the risk associated with the project by ensuring that the program is first used as a prototype rather than the real deal. It ensures better quality. When users interact with the prototypes, they are able to provide very useful feedback that goes back into development to enhance the quality of the project.

Cheers!

What is the role of CPU in the computer system?

Answers

Answer:

role of cpu in computer is ut is a brain nd a power point if a computer

Explanation:

It helps of shut down and open it

Answer:

CPU is considered as the brain of the computer. CPU performs all types of data processing operations. It stores data, intermediate results, and instructions (program). It controls the operation of all parts of the computer.

This is the department that is responsible for hiring, firing, training, new employees for the business or corporation.
Group of answer choices

Human Resources

Information Technology

Advertising

Marketing

Answers

Answer:

Explanation:

human resources

hoped this helped

Why would a network administrator want to filter certain ports when capturing data such as FTP traffic

Answers

Answer:

To avoid receiving malware-infected files like spam.

Explanation:

Hackers use malware to gain unauthorized access to company files and information for personal gain. Files infected by the malware can infect other systems or files. There are various types of malware namely; virus, trojan horse, worm, spyware, ransomware, adware etc.

Which term describes a visual object such as a picture a table or text box

Answers

the correct answer is “caption”

Answer: caption

Explanation:

Edge 2020

What question did the use of a telescope by Hubble answer?

A

Is Earth the center of the universe


B

Is the sun the center of the universe


C

How do the planets move in the solar system


D

Are there more galaxies beyond the Milky Way

Answers

Answer:

The Answer is D

Corina has added animations to objects on a particular slide within a presentation. She needs to reorder the animations. How should she achieve this goal?

A. Use the Preview button.
B. Access the Advanced timeline.
C. Use the Animation pane.
D. Delete and recreate the animations in the correct order.

Answers

I think it's B but im not 100% sure sorry if im wrong

Answer: C

Explanation:

Allison is writing a program in Java and keeps getting an error. Which line of code is causing the error?

A. Int a = 0, b = 3, c;
B. for(i = 0, i <= 13, i++) {
C. c = (a * 2) + i;
D. System.out.println(c);

}

Answers

B will cause an error.

Allison needs to declare a type for variable i and use semi-colons.

The for statement should be for(int i = 0; i <=13; i++){

Write a program to print the prime numbers from 500 to 700. The program should also print the count of prime numbers between 500 and 700. A number is called a prime number if it has exactly two positive divisors, 1 and the number itself. For example, the number 5 is prime as it has only two divisors: 1 and 5.

Answers

primes = 0

for x in range(500, 701):

   count = 1

   for w in range(2, x+1):

       if x % w == 0:

           count += 1

   if count < 3:

       print(x, end=" ")

       primes += 1

print("\nThere are {} prime numbers between 500 and 700".format(primes))

I hope this helps!

An IEEE 802.1D port goes through four states when transitioning to the forwarding state. What is the correct order?

Answers

Answer:

Blocking, listening, learning and forwarding.

Explanation:

An IEEE 802.1D is the media access control (MAC) Bridges standardized by the IEEE group which includes bridging, Spanning tree and other protocols.

An IEEE 802.1D port goes through four states when transitioning to the forwarding state. The correct order are blocking, listening, learning and forwarding.

On his website, Mario has a video that visitors must click to play. He wants the video to play automatically when the page loads. What attribute should Mario add to the
A. controls
B. loop
C. autoplay
D. play

Answers

Answer:

C: AutoPlay

Explanation:

it is C because the definition of AutoPlay is: a functionality that causes a video, audio file, etc. to play automatically, without action from a user.

How do I do these? I dont understand.

Answers

I don’t understand either, I would suggest contacting your teacher or maybe searching up videos or tutorials on how to solve such a problem.

Using range(1,101), make two list, one containing all even numbers and other containing all odd numbers. How can I do this on Python

Answers

Answer:

even = []

odd = []

for i in range(1,101):

if i % 2 == 0:

even.append(i)

else:

odd.append(i)

Using range(1,101), the list of even and odd number can be done in python as follows;

odd_numbers = []

even_numbers = []

for i in range(1, 101):

  if i%2 == 0:

     even_numbers.append(i)

  else:

     odd_numbers.append(i)

print(even_numbers)

print(odd_numbers)

The variable odd_numbers is initialise with an empty list

The variable even_numbers is initialise with an empty list.

Then we loop through the range 1 to 101 as required.

If the looped numbers is divided by 2 without a remainder then the number is appended to the empty list even_numbers.

Else if it has a remainder, the looped number are appended to the empty list, odd_numbers.

Then we print the even_numbers and odd_numbers.

learn more about python here; https://brainly.com/question/14157737?referrer=searchResults

Acrostics, acronyms, and rhymes are a few examples of __________. A. a visual strategy B. the misinformation effect C. memory reconstruction D. a mnemonic device Please select the best answer from the choices provided A B C D

Answers

Answer:

The answer is D) A mnemonic device

Answer:

D

Explanation:

I hope this helps! Sorry if it is wrong ;-;

Which of the following would be appropriate to create using the CMYK color model?

Select all that apply.

a printed takeout menu a printed takeout menu , ,

a photography blog a photography blog , ,

a tri-fold brochure a tri-fold brochure , ,

a mobile app logo

Answers

Answer:

B, and C

Explanation:

they look like the only two answers that make sence

Write a multi-way if statement that compares the double variable pH with 7.0 and makes the following assignments to the bool variables neutral, base, and acid:

Answers

Answer:

try:

   pH = float(input("Enter number between 0 to 14: "))

except ValueError:

   print("input must be a number")

if pH < 7:

   print("pH is Acidity")

elif pH == 7:

   print("pH is neutral")

else:

   print("pH is Base/alkaline")(

Explanation:

The try and except statement is used to check if the input is a number, if its not, the print statement is displayed. The nested if statement compares the pH input to know if it is an acid, base or neutral.

How would you reply to an email message you've received that has multiple recipients, all of whom you would like to see your reply?

Answers

Answer:

depends on the app. if it's in google you can hit the reply all button and that will send the reply to all people or you can copy the email addresses from the original email into a new email

Answer:

the answer is c :D

Explanation:

Who wants to play nitro type with me. My user is thievesGuildcuu

Answers

Answer:

I can

Explanation:

Answer:

Sure.

My user Name is: Queen Void.

What is payload?
a block of data inside the packet
a block of data transmitted across a network
the maximum amount of data a network can transmit
a 32-bit numeric address

Answers

Answer:

a block of data inside the packet

Which input value causes the loop body to execute a 2nd time, thus outputting "In loop" again? { String s = "Go"; while ((!s.equals("q"))&& (!s.equals("")) System.out.println("In loop"); 5 - scnr.nextO;
a) "Quit"
b) "q" only
c) "Q only
d) Either "q" or "Q"

Answers

Answer:

a) "Quit"  

c) "Q only

Explanation:

Given

String s = "Go";

while ((!s.equals("q"))&& (!s.equals("")))  {

System.out.println("In loop");

s = scnr.next();

}

Required

What input causes another execution

Analyzing the while condition

while ((!s.equals("q"))&& (!s.equals("")))  

This can be split into:

!s.equals("q")) && (!s.equals(""))

Meaning

When s is not equal to "q" and when s is not an empty string

In other words,

the loop will be executed when user input is not "q" and user input is not empty.

So, from the list of given options: The loop both will be executed when:

a) Input is "Quit"

c) Input is Q only

Input of q will terminate the loop, hence b and d are incorrect

Other Questions
The major features of the U.S. free enterprise system include:O A. freedom for companies to produce the products they want.B. a small number of companies put in charge of economicdecisions.c. economic motivations based on a desire to promote equality.O D. government control over most sectors of the economy. at midnight the temperature in alto is -3.8 the wind chill makes the temperature feel 5.6 colder then the actual temperature what is the wind-chill temperature A CST is working with a neurosurgeon on a left frontal craniotomy to remove a meningioma. He has just made the scalp incision when a unit charge nurse quickly enters the OR saying, CSP just called, and there was a malfunction of the steam sterilizer last night. The sterilizer chart doesnt confirm that these instruments went through a complete cycle even though the biological indicators have a negative reading.What steps should the OR team take at this point? A password is formed by selecting three letters from the alphabet, followed by one number from 0 to 9. Ifrepetition is not allowed, how many potential passwords can be created?A. 156,000B.175,760C.140,400D.85 Which diagram best illustrates the effects of an important event in Mexican history? O A. The United States goes to war with Mexico. Mexico gains new territory OB. Mexico fights for independence from Spain. The United States invades Mexico. OC. Mexican leader Benito Jurez dies The Mexican Revolution begins. O D. Spain defeats the Aztec Empire. Mexico becomes an independent republic. A figure Quadrant lll was transformed, and the image is in Quadrant IV. Which could NOT have been the transformation. A and B are two cities.ztx a) Measure the bearing of B from A.AXb) Measure the bearing of A from B. if you answer both questions Ill give you branliest (Explain in detail) if you research, try your best to rephrase some words :) Select the correct answer.What type of money did the Greenback Party recommend?A. easyB. soundC. hardD. loud Which factor contributed to the growth of the U.S. economy during the 20thcentury?O A. The United States became an industrial leader.B. The United States suffered heavy losses in World War I.C. The United States cut off trade with foreign countries.D. The United States continued to use the gold standard What is the period that girls go through? The length of a small ant is 3\cdot 10^{-3}310 3 meter and the length of a large ant is 3.5\cdot 10^{-2}3.510 2 meter. a.) Find the difference in length, in millimeters, of the two ants.Write your answer in scientific notation. If there is a trail of 2 small ants and 1 large ant in a straight line, find the total length of the line. Write your answer in scientific notation. Objects and figures that are drawn with correct proportions have a sense of order and balance. Before he buys a new smartphone, Tim can best use data to?A=evaluate which phone he should getB-=Convince himself he wants a phone. C=Discredit other's opinions oh his phone choice.D=Recognize problems I need some help with this math problem Haireut $24Tip 15%Tiptotal IU Select the correct answer. What is the product of (7) (-16)(-7)(-1) O A. --7 O B. - 26 oc/ OD. 2 which is the solution to the inequality 2 3/5 b-8/15 Question in picture!!!!!! PLEASE HELP ME!!!!!!!!