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
Veseljchak [2.6K]
3 years ago
11

Rewrite the following program segment using a while loop instead of a for loop.

Computers and Technology
1 answer:
balandron [24]3 years ago
6 0

Answer:

while i=0 or i<100:

if (i%2==0):

print(i)

You might be interested in
My computer just fried anybody know why it did that?
pochemuha
You was probably was too MLG and it blew its top my boy !
7 0
3 years ago
Read 2 more answers
Change the Towers of Hanoi program so that it does the following: a)Counts the number of ring moves and prints that - instead of
aniked [119]

Answer:

Following are the program in the Java Programming Language.

//import scanner class package

import java.util.Scanner;

//define class

public class Tower_of_Hanoi {

//define static integer variable

public static int count = 0;

//define function

public static void Permute_Arrange(int n, char x, char ax, char to) {

//set if statement

if (n == 1) {

//increament in count by 1

++count;

}

//otherwise  

else  

{

Permute_Arrange(n - 1, x, to, ax);

++count;

Permute_Arrange(n - 1, ax, x, to);

}

}

//define main function

public static void main(String[] args)  

{

//set scanner type object

Scanner sc = new Scanner(System.in);

//print message

System.out.println("Enter less than 0 to exit");

//set the while infinite loop

while(true)

{

//print message

System.out.print("Enter the number of Disks: ");

//get input from the user

int num_of_disk = sc.nextInt();

//set the if statement to break the loop

if(num_of_disk<0)

{

//exit from the loop

System.exit(0);

}

//call the function

Permute_Arrange(num_of_disk, 'A', 'B', 'C');

//print message with output

System.out.println("Total number of Disc Moves is: " + count);

count = 0;

}

}

}

<u>Output:</u>

Enter less than 0 to exit

Enter the number of Disks: 4

Total number of Disc Moves is: 15

Enter the number of Disks: 7

Total number of Disc Moves is: 127

Enter the number of Disks: -1

Explanation:

Here, we define a class named "Tower_of_Hanoi"

  • Set the integer data type static variable "count" and initialize the value to 0.
  • Define void data type static function "Permute_Arrange" and pass three characters type arguments "x", "ax", and to and one integer type argument "n", inside it we set if condition to increment in the count variable otherwise call the function.
  • Finally, we define the main function to get input from the user and pass the argument list in function and call the function.
8 0
4 years ago
What does ""fair use"" mean regarding copyrighted works?
Nady [450]

In regards copyrighted works, fair use is simply known as legal dogma that allows the right to free expression by allowing the unlicensed use of copyright-protected works by individuals as regards to some certain situations.

Fair Use of copying of copyrighted material can only be used in a short and revelatory us, example to criticize, or caricature of a copyrighted work. It is often known to be a legal defense that protects individuals of copyrighted material from copyright infringement.

  • Fair use allows a person/people to use a copyrighted work without acknowledgement or permission of copyright owner and it can be used  to criticize, comment, news reporting, teaching, research etc. It is not seen as infringement under the law.

Conclusively, we can say that In regards copyrighted works, fair use is simply known as legal dogma that allows the right to free expression by allowing the unlicensed use of copyright-protected works by individuals as regards to some certain situations.

Learn more from:

brainly.com/question/1534807

5 0
2 years ago
"Bullet Lists" can be which of the following?
MariettaO [177]

Answer:

letters and numbered

Explanation:

7 0
4 years ago
Read 2 more answers
What is technology? *
natta225 [31]

Answer: All of the above is the answer

4 0
3 years ago
Other questions:
  • State one advantage of organising data into columns and rows
    11·1 answer
  • Design a database to keep data about college students, their academic advisors, the clubs they belong to, the moderators of the
    12·2 answers
  • A sentinel value ________ and signals that there are no more values to be entered:____
    14·1 answer
  • Early in the history of technology, the development of tools and machines was based on _____ versus scientific knowledge as is d
    14·1 answer
  • Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
    10·1 answer
  • Suppose a class Car and its subclass Honda both have a method called speed as part of the class definition. rentalH refers to an
    5·1 answer
  • Write a function that takes a list and returns its first element​
    15·1 answer
  • The sequence of Figures shows a pattern. if the pattern repeats, how many triangles will the figure 5 have ?​
    7·1 answer
  • What kind of software consists of programs designed to make users more productive and/or assist them with personal tasks?.
    15·1 answer
  • Consider an individual who wishes to ensure that their information remains secure and confidential, possibly to secure their per
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!