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
nlexa [21]
3 years ago
15

4.5 Code Practice

Computers and Technology
1 answer:
Alex787 [66]3 years ago
5 0

Answer:

The answer to this question is given below in the explanation section.

Explanation:

This program is written in C++.

                                                                         

#include <iostream>

using namespace std;

int main()

{

   

   string word;// variable for taking user input

   int cond;// to set condition true if user preses the stop and exit from loop

   

   cout<<"Enter word: \n";

   cin>>word;

   do// start while loop

   {

       

       

       if(word=="stop" || word =="STOP" || word == "Stop")// if user enter word stop, then program exit

       {

       cond=0;

       

       }

       else//otherwise loop continue

       {

           cout<<" You Entered "+ word +"\n";

           cout<<"Enter word: \n";

           cin>>word;

           cond=1;

       }

   }  

   while(cond == 1);// if user don't enter word "stop" loop run continuesly.  

   cout<<"Program exit";

   

   return 0;

}

You might be interested in
Naruto Uzumaki who likes naruto ??? who waches it??
nika2105 [10]

Answer:

me

Explanation:

naruto is the coolest dude

6 0
3 years ago
Read 2 more answers
Fill in the blanks to make the factorial function return the factorial of n. Then, print the first 10 factorials (from 0 to 9) w
nadezda [96]

Answer:

Following are code of factorial in python language

def factorial(n): # function

   result=1 #variable

   for x in range(2,n+1): #iterating the loop

       result=result*x  #storing result

   return result #return result

for n in range(10): #iterating loop

   print(n,factorial(n)) #print factorial

Output:

Following are the attachment of output

Explanation:

Missing information :

In the question the information is missing the code is missing which we have to correct it following are the code that are mention below.

def factorial(n): # function

   result=1 #variable

   for x in range(       ): #iterating the loop

       result=  #storing result

   return  #return result

for n in range(  ): #iterating loop

   print(n,factorial(n)) #print factorial

Following are the description of code

  • We have create a function factorial  in this we have pass the one parameter i.e "n".
  • In the for loop we have pass 2,n+1 which has been used to iterating the loop calculating factorial and string the result in the result variable
  • In the main function we have pass the range on which we have to calculated the factorial
  • Finally the print function will print the factorial .

Following are the attachment snip of code in the python language

3 0
2 years ago
You load an image file into a numpy array and look at its shape, which is (433, 650). What does this indicate?
Nat2105 [25]

Answer:

option C

Explanation:

The correct answer is option C

the uploaded image shape is ( 433 , 650 )

this shape means that the image is a grayscale image which is 433 pixels high by 650 pixels wide.

a gray scale image is  in white and black color.

433 pixels high by 650 pixel wide means that the image is formed with the combination of 433 vertical dots and 650 horizontal dots.

Resolution of an image can be found out by the  pixels present in the images.

higher the pixel higher is he resolution of the image.

6 0
2 years ago
Define the computer with its workintg principple
GenaCL600 [577]

Explanation:

Computer is an electronic device that is designed to work with information.

WORKING PRINCIPLE OF COMPUTER

a.It accepts data and instructions by way of input,

b.It stores data,

c.It can process data as required by the user,

d.It gives result in the form of output,

e.It controls all operations inside a computer.

I hope it will help you

5 0
2 years ago
What is the difference between a method and a function? In what ways are they similar? Why do you think Python makes a distincti
makvit [3.9K]

Answer:

A method in python is somewhat similarto a function, except it is associated with object/classes. Methods in python are very similar to functions except for two major differences. The method is implicitly used for an object for which it is called. The method is accessible to data that is contained within the class.

5 0
3 years ago
Other questions:
  • In steps<br> Urgent please
    14·1 answer
  • . double x = 5; declares that x is a...............variable.
    14·1 answer
  • Your desktop, internet explorer, and the media player can be started from this area on most computers
    9·1 answer
  • MS Excel is a powerful spreadsheet program that helps people with complex mathematical calculations. In what ways could you use
    10·1 answer
  • Which is said to be ‘computer on a chip’ (a) Micro processors (b) Microcontrollers (c) Both (c) None of the above
    9·1 answer
  • Creating Classes
    10·1 answer
  • Why is 0.3333333333333333 the output of print(1/6 + 1/6) in python?
    8·1 answer
  • Does nature behave the exact same way as fractals?
    15·1 answer
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    15·1 answer
  • JAVA CODE.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!