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
hram777 [196]
3 years ago
6

4.5 Code Practice

Computers and Technology
1 answer:
dmitriy555 [2]3 years ago
7 0

i = 0

while True:

   user_input = input("Please enter the next word: ")

   if user_input == "STOP":

       break

   i += 1

   print("#{}: You entered {}".format(i,user_input))

print("All done. {} words entered.".format(i))

First we set i equal to zero so that we can keep track of how many words we input.

We set while True so that its a continuous loop until a certain condition is met to break out of the loop.

user_input is set equal to whatever word the user enters.

our if statement tells us to break out of the while loop if the user inputs "STOP"

If the user does not enter STOP i is set equal to itself plus 1. This just means we add one to i for every new word entered.

Then we print whichever word is entered.

After the while loop, we print All done and the quantity of words entered.  

You might be interested in
You are opening a store, and having a working website is an important part of your project plan. The company that started creati
masya89 [10]

Answer:

I think it might be Budget and time. :)

5 0
3 years ago
What is the full form of GUI​
Nonamiya [84]

Answer:

The graphical user interface (GUI /dʒiːjuːˈaɪ/ jee-you-eye or /ˈɡuːi/) is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based user interfaces, typed command labels or text navigation.

4 0
3 years ago
Read 2 more answers
The backbone networks of the Internet are typically owned by long-distance telephone companies called
Aneli [31]

Answer:

network service providers

Explanation:

The backbone networks of the Internet are typically owned by long-distance telephone companies called network service providers.

A network service provider can be defined as a business firm or company that is saddled with the responsibility of leasing or selling bandwidth, internet services, infrastructure such as cable lines to small internet service providers.

5 0
3 years ago
3. (20 points) Write a C++ recursive function that finds the maximum value in an array (or vector) of integers without using any
Luden [163]

Answer:

Following are the code to this question:

In option (i):

#include <iostream>//defining header file

using namespace std;

int findMax(int B[], int x)//defining recursive method findMax

{

if (x == 1)//defining condition when value of n==1

return B[0];//return array first element

return max(B[x-1], findMax(B, x-1)); // calling recursive method inside max method and return value

}

int main() //defining main method  

{

int B[] = {12, 24, 55, 60, 50, 30, 29};//defining array B

int x= 7;//defining integer variable and assign a value

cout << "Maximum element value of the array is: "<<findMax(B, x)<<endl;//calling method findMax and print value

return 0;

}

Output:

Maximum element value of the array is: 60

In option (ii):

\Rightarrow \ T(n) = 1 + T(n-1)\\\Rightarrow  1 + 1 + T(n-2)\\ \Rightarrow  1 + 1 + 1 + ... n \ times \\\Rightarrow  O(n) \\

Explanation:

In the above-given program a recursive method "findMax" is defined, which accepts an array "B" and an integer variable "n" in its parameter, inside the method a conditional statement is used that, checks value of x equal to 1.

  • If the above condition is true it will return the first element of the array and find the max number.
  • Inside the main method, an array B is declared that assigns some values and an integer variable is declared, that also assigns some values, in the last step print method is used that pass value in method and prints its return value.
  • In the option (ii) we calculate the Big-O notation algorithm value.
5 0
3 years ago
I NEED HELP PLEASE ITS TIMED
morpeh [17]

Answer:

Ellipse

Explanation:

function draw() {

 background("white");

 noFill();

 ellipse(200, 200, 200, 100);

 //            ↑       ↑       ↑      ↑

 //     posx posy length hieght

 drawSprites();

}

https://studio.code.org/projects/gamelab/Y476cgGC5lsXag4wVEWkMbdpu1ICsHiy7_g7VZj2MwA

5 0
3 years ago
Other questions:
  • Assign decoded_tweet with user_tweet, replacing any occurrence of 'TTYL' with 'talk to you later'. Sample output with input: 'Go
    14·2 answers
  • You can upgrade a cpu by adding registers and cache memory to it. <br> a. True <br> b. False
    7·1 answer
  • Jump to Question: Fill in the blanks below: The flow of electricty is similar to the movement of water through a pipe. The movem
    15·1 answer
  • Given that a function receives three parameters a, b, c, of type double, write some code, to be included as part of the function
    11·1 answer
  • What does mean I can’t turn on my computer and my computer won’t charge at all
    15·1 answer
  • Describe the objectives of e-commerce ?​
    5·1 answer
  • A recursive method may call other methods, including calling itself. Creating a recursive method can be accomplished in two step
    14·1 answer
  • Which of these is NOT an input device?
    14·1 answer
  • Draw the 2-3 tree that results when you insert the keys E A S Y Q U T I O N in that order into an initially empty tree
    12·1 answer
  • True of false that the memory of laptop is normally measured in kilobytes
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!