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
Setler [38]
3 years ago
8

The while loop has two important parts: a condition that is tested and a statement or block of statements that is repeated as lo

ng as the expression ________.
Computers and Technology
1 answer:
natima [27]3 years ago
8 0

Answer:

TRUE

Explanation:

The while loop is used to run the block of statement again and again until condition is TRUE. if condition false program terminate the loop and execute the next of while statement.

syntax:

initialize;

while(condition)

{

 statement;

  increment/decrement;

)

when condition is TRUE, the block of statement execute again and again.

You might be interested in
True or False?
Nadya [2.5K]

False.

The different between break and continue instruction is that with break you exit the loop, and with continue you skip to the next iteration.

So, for example, a loop like

for(i = 1; i <= 10; i++){

   if(i <= 5){

       print(i);

   } else {

       break;

   }

}

will print 1,2,3,4,5, because when i=6 you will enter the else branch and you will exit the loop because of the break instruction.

On the other hand, a loop like

for(i = 1; i <= 10; i++){

   if(i % 2 == 0){

       print(i);

   } else {

       continue;

   }

}

Will print 2,4,6,8,10, because if i is even you print it, and if i is odd you will simply skip to the next iteration.

6 0
3 years ago
Write a statement that reads 5 successive integers into these variables that have already been declared: x1, x2, x3, x4, x5. The
prisoha [69]

Answer:

Following are the statement in C++ language :

#include <iomanip> // header file  

using namespace std; // namespace

int main() // main method  

{

   int x1,x2,x3,x4,x5; // variable declaration

cout<<" Enter the 5 sucessive integer:";

cin>>x1>>x2>>x3>>x4>> x5; // taking 5 input from user

cout<<right;

// prints each  of  its own line and form a right-justified  

cout<<setw(5)<< x1 << "\n" << setw(5) << x2 << "\n" <<setw(5) << x3 << "\n" << setw(5) << x4 << "\n" << setw(5) << x5 << "\n";

return(0);    

}

Output:

Enter the 5 sucessive integer: 45

23

445

6

8

 

  45

  23

 445

   6

   8

Explanation:

Description of program is given below  

  • Declared a 5 integer value x1,x2,x3,x4,x5 respectively.
  • Read the 5 integer value from user by using cin funtion.
  • Finally Print these 5 value in its own line and form a right-justified by using setw() function on it
5 0
3 years ago
Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than
Gnoma [55]

Answer:

public static void print_popcorn_time(int bag_ounces){

       if(bag_ounces<3){

           System.out.println("Too Small");

       }

       else if(bag_ounces>10){

           System.out.println("Too Large");

       }

       else{

           bag_ounces*=6;

           System.out.println(bag_ounces+" seconds");

       }

   }

Explanation:

Using Java prograamming Language.

The Method (function) print_popcorn_time is defined to accept a single parameter of type int

Using if...else if ....else statements it prints the expected output given in the question

A complete java program calling the method is given below

public class num6 {

   public static void main(String[] args) {

       int bagOunces = 7;

       print_popcorn_time(bagOunces);

   }

   public static void print_popcorn_time(int bag_ounces){

       if(bag_ounces<3){

           System.out.println("Too Small");

       }

       else if(bag_ounces>10){

           System.out.println("Too Large");

       }

       else{

           bag_ounces*=6;

           System.out.println(bag_ounces+" seconds");

       }

   }

}

3 0
3 years ago
I NEED HEP QUICK
avanturin [10]

Answer:

O = (C2+C3+C4+C5)-81

Explanation:

5 0
2 years ago
A common use-case for dictionaries is to store word counts. Let's modify our program below to store the count for each unique wo
baherus [9]

Answer:

word_count={}

for i in text.split:

        if i in word_count:

                word_count[i]+=1

         else:

                 word_count[i]=1

print word_count

8 0
3 years ago
Other questions:
  • When you schedule an appointment, Outlook adds the appointment to the ____ folder by default.
    9·1 answer
  • An ink-jet printer is a type of impact printer. <br> a. True <br> b. False
    8·1 answer
  • Write a program that prompts the user to enter the number of integer numbers you need to enter, then ask user to enter these int
    5·1 answer
  • What are html documents also called?
    12·1 answer
  • Explain how Steve Jobs created and introduced the iPhone and iPad.
    9·1 answer
  • 7.
    15·1 answer
  • What is one purpose of an essay’s conclusion paragraph?
    13·1 answer
  • Write a program that has the user input how many classes they are taking this semester and then output how many hours they will
    8·2 answers
  • Write 3 things that can't be done without technology.
    14·2 answers
  • Which properties would be useful to know to search for a Word document? Check all that apply.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!