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
matrenka [14]
1 year ago
15

The while loop is also known as what kind of a loop? entry-control loop operational loop infinite loop user-control loop

Computers and Technology
1 answer:
Alexxx [7]1 year ago
7 0
Entry control loop. Because a while loop can be infinite or not based on whether Boolean given is T or F. So we need to know the preexisting condition before we can solve it.
You might be interested in
Alright, so im currently trying to pass a computer science class. i need it done in a little under 2 weeks. Ill just ask the one
Alla [95]

Answer:

B. Mesh

Explanation:

5 0
2 years ago
Borrowing money affects both assests and owners equity. True or false?​
shtirl [24]
It should be true, hopefully I’m right
6 0
2 years ago
You have the templates of 2 classes, Person and Program. The Person class has 4 attributes, name, age, major and gpa. There is a
Ostrovityanka [42]

Answer:

Hi, I'm going to put the code answer here and you put in the corresponding line to not copy all the code in the answer.

replace the following line or adjust to the following code

/*

* CODE HERE

while(personSelect <= 0 || personSelect  > 5) {

System.out.println("Wrong number, try to input the number in range 1 to 5" );

personSelect = scan.nextInt();

}

if(personSelect == 1){

person1.setGpa(newGPA);

printInfo()

}

else if(personSelect == 2){

person2.setGpa(newGPA);

printInfo()

}

else if(personSelect == 3){

person3.setGpa(newGPA);

printInfo()

}

else if(personSelect == 4){

person4.setGpa(newGPA);

printInfo()

}

else {

person5.setGpa(newGPA);

printInfo()

}

*/

Explanation:

According to the description of code, we have to add some lines to resolve the questions.

a):

In base on the input, we have to modify the <em>attribute GPA</em> with the method <em>setGpa</em> depending on the person chosing. We call the person chosen before and also call the method setGpa( ) and pass  as <em>parameter</em> the GPA value obtained in tha last input

b)

In this case we have to <em>create a loop</em> for iterate the times that is necesary to get a value of person that is permit in <em>range 1 to 5</em>, and hence that we create and individual if condition to assign the GPA to the person chosen.

I hope it's help you.

8 0
3 years ago
3.4 lesson practice quiz edhesive
Marina86 [1]

3.4 lesson practice quiz edhesive :

Write a program to check if user inputs "yellow"

Answer:

In Python:

col = input("Enter Color: ")

if col == "yellow":

   print("True")

else:

   print("False")

Explanation:

This prompts the user for color

col = input("Enter Color: ")

This checks if color is yellow

if col == "yellow":

If true, this prints true

   print("True")

If otherwise, this prints false

else:

   print("False")

5 0
2 years ago
Write a function called factor that determines for a pair of integers whether the second integer is a factor of the first. The f
Aleks04 [339]
<h2>Answer:</h2>

//import the Scanner class to allow for user's input

import java.util.Scanner;

//Declare the class and call it FactorClass

public class FactorClass {

   

   //Declare the function factor

   //It returns either true or false, therefore the return type is boolean

   //It receives two arguments - a and b

   public static boolean factor(int a, int b){

       

       //Check if a is divisible by b.

       //Return true if yes

       if(a % b == 0){

           return true;

       }

       

       //return false if a is not divisible by b

       return false;

   

   }  // End of method factor

   

   

   //The main method to test the function factor()

   public static void main(String[] args) {

       

       //Create an object of the Scanner class

       Scanner input = new Scanner(System.in);

       

       //Prompt the user to enter the pair of numbers

       System.out.println("Enter the pair of numbers (separated by a space)");

       

       //grab and store the first number in a variable

       int firstnum = input.nextInt();

       

       //grab and store the second number in another variable

       int secondnum = input.nextInt();

       

       

       //With the variables, call the factor() method

       //If it returns true, print the adequate message

       if(factor(firstnum, secondnum)){

           System.out.println(secondnum + " is a factor of " + firstnum);

       }

       

       //If it returns false, print the adequate message

       else{

           System.out.println(secondnum + " is NOT a factor of " + firstnum);

       }

   

 }            // End of main method

   

}    // End of class declaration

==============================================================

<h2>Sample Output 1:</h2>

>> Enter the pair of numbers  separated by a space

8 4

>> 4 is a factor of 8

==============================================================

<h2>Sample Output 2:</h2>

>> Enter the pair of numbers  separated by a space

9 4

>> 4 is NOT a factor of 9

==============================================================

<h2>Explanation:</h2>

The above code has been written in Java and it contains comments explaining every segment of the code. Kindly go through the comments for better understanding of the code.

For simplicity, the code is re-written as follows with little or no comments;

import java.util.Scanner;

//Declare the class and call it FactorClass

public class FactorClass {

   

   public static boolean factor(int a, int b) {

       if(a % b == 0){

           return true;

       }

       

       //return false if a is not divisible by b

       return false;

   

   }  // End of method factor

   

   

   //The main method to test the function factor()

   public static void main(String[] args) {

       

       //Create an object of the Scanner class

       Scanner input = new Scanner(System.in);

       

       //Prompt the user to enter the pair of numbers

       System.out.println("Enter the pair of numbers (separated by a space)");

       

       //grab and store the first number in a variable

       int firstnum = input.nextInt();

       

       //grab and store the second number in another variable

       int secondnum = input.nextInt();

       

       

       if(factor(firstnum, secondnum)){

           System.out.println(secondnum + " is a factor of " + firstnum);

       }

       

       else{

           System.out.println(secondnum + " is NOT a factor of " + firstnum);

       }

    }

   

}

3 0
3 years ago
Other questions:
  • In an office there is a unisex bathroom with n toilets. The bathroom is open to both men and women, but it cannot be used by men
    14·1 answer
  • Look act the picture
    5·1 answer
  • The following algorithm computes the average height for a list of basketball player heights. Initialize a variable sum to 0. For
    11·2 answers
  • Then standard toolbar appears whenever you select text true or fals
    15·1 answer
  • What are interpersonal skills?
    12·2 answers
  • Suppose you are choosing between four different desktop computers: one is Apple MacIntosh and the other three are PC-compatible
    15·1 answer
  • What is a fire wall and how does it work
    14·1 answer
  • Write in language C, please.
    8·1 answer
  • Profitability, consumer relations, and competition are involved in what kinds of concerns in the design process?
    12·1 answer
  • The objective fuction of linear progrmming should be
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!