Consider the following code:
val = 0
while (val < 10):
val = val - 1
print (val)
What is the error?

Answers

Answer 1

Answer:

The code will get stuck in an infinite loop.

Explanation:

Since val is decreasing by 1 each time it meets the criteria of being smaller than 10, your code will get stuck in an infinite loop since val will always be smaller than 10.

Hope this helps :)


Related Questions

A swimming pool has a length of 28 feet, a width of 17 feet, and a depth of 6 feet. How much water can the swimming pool hold?

Answers

2140 Gallons/LBFOR EACH AND JOE BIDEN WONNN YAAAA

an organization wants to use its computer to make video calls with suppliers overseasename two input and two output device that the organisation must have for this to happen and briefly explain the popruse of each device

Answers

Answer:

an organization wants to use its computer to make video calls with suppliers overseasename two input and two output device that the organisation must have for this to happen and briefly explain the popruse of each device

50 POINTS
in Java
A palindrome is a word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run.

In this program, ask the user to input some text and print out whether or not that text is a palindrome.

Create the Boolean method isPalindrome which determines if a String is a palindrome, which means it is the same forwards and backwards. It should return a boolean of whether or not it was a palindrome.

Create the method reverse which reverses a String and returns a new reversed String to be checked by isPalindrome.

Both methods should have the signature shown in the starter code.

Sample output:

Type in your text:
madam
Your word is a palindrome!
OR

Type in your text:
hello
Not a palindrome :(

Answers

import java.util.Scanner;

public class JavaApplication52 {

   public static String reverse(String word){

       String newWord = "";

       for (int i = (word.length()-1); i >= 0; i--){

           newWord += word.charAt(i);

       }

       return newWord;

   }

   public static boolean isPalindrome(String word){

       if (word.equals(reverse(word))){

           return true;

       }

       else{

           return false;

       }

   }

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Type in your text:");

       String text = scan.nextLine();

       if (isPalindrome(text) == true){

           System.out.println("Your word is a palindrome!");

       }

       else{

           System.out.println("Not a palindrome :(");

       }

   }

   

}

I hope this works!

The___ of a variable is determined by which parts of a program can view and change its value

Answers

The missing word is scope. Wherever a variable is declared, is its scope. A variable can be manipulated or called on only in its scope.

The scope of a variable is determined by which parts of a program can view and change its value. The correct option is C.

What is a variable?

A variable in programming is a value that can change depending on the conditions or information passed to the program.

A program is typically made up of instructions that tell the computer what to do and data that the program uses while running.

Variables are used to store data that can be accessed and manipulated by a computer program. They also allow us to label data with descriptive names, making our programs easier to understand for both the reader and ourselves.

In layman's terms, a variable's scope is its lifetime in the program. This means that the scope of a variable is the entire program's block of code where the variable is declared, used, and can be modified.

Thus, the correct option is C.

For more details regarding variable, visit:

https://brainly.com/question/17344045

#SPJ2

Your question seems incomplete, the missing options are:

influence

magnitude

scope

range

Please help answer now! First correct answer get branliest! Place the directions in order from first to last to explain how to hide the ribbon from the top of your Excel worksheet.

Move the cursor to the top-right corner

Select the auto-hide ribbon

Click on the up arrow

Answers

Answer:

just do bodldld

Explanation:

Answer:

Move the cursor to the top-right corner

Click on the up arrow

Select the auto-hide ribbon

Explanation:

__ is a process of adding details to a model to make it less abstract.
• abstraction
• decomposition
• pattern recognition
• refinement

Answers

Answer:refinement

Explanation:

Answer:

refinement

Explanation: just checked

What are the two reasons we analyze algorithms?

Predict performance

Make decisions about what algorithm to use

Sorting Data

Ease of coding

Answers

Answer:

Predict performance  

 Make decisions about what algorithm to use

Explanation:

The two reasons we analyze algorithms are:

A. Predict performance B. Make decisions about what algorithm to use

An algorithm refers to those steps and processes which a person undertakes in order to solve a problem.

As a result of this, it is important that we make analysis of an algorithm so that we can make predictions which would help us take vital decisions about the type of algorithm to use.

Therefore, the correct answers are options A and B

Read more here:

https://brainly.com/question/17648604

35 POINTS
In Java PLS
This program is the beginning of an automated order machine. You are programming the piece that gets the number of the order from the label sent to you by the ordering machine.

The ordering machine is simulated with user input. It sends a full label, such as “3. Veggie Burger”.



Fill in the missing code
Your task is to get the number out of the string. To do this, you need to isolate the number by using substring. Then use Integer.valueOf, a static method of Integer that takes a String and returns the integer value contained in the String.

The final program should look something like this

1. Hamburger
2. Cheeseburger
3. Veggie Burger
4. Nachos
5. Hot Dog

Enter label:
5. Hot Dog
Customer ordered number 5

This is the code given:
import java.util.Scanner;

public class PickupWindow
{
public static void main(String[] args)
{
// Create scanner object
Scanner input = new Scanner(System.in);

// Display menu
String menu = "1. Hamburger\n2. Cheeseburger\n3. Veggie Burger\n4. Nachos\n5. Hot Dog\n";

System.out.println(menu);

// Get customer order
System.out.println("Enter label: ");
String customerOrder = input.nextLine();

// Use substring to get the first character (the number)
String combo =

// Create an Integer object by using the static
// method Integer.valueOf(someString)
// to turn the string into an Integer

Integer comboNumber =

// Print out what the customer ordered
System.out.println("Customer ordered number "


}
}

Answers

Answer:

Complete the program as follows:

1. Replace

String combo =

with

String combo = customerOrder.substring(0);

2. Replace

Integer comboNumber =

with

Integer comboNumber = Integer.parseInt(combo);

Explanation:

Required

Fill in the missing codes

From the code given, there are only two gaps to be filled and they are:

1. String combo =

2. Integer comboNumber =

1. String combo =

The first is to get the first index of customerOrder using substring.

The syntax of this is:

variable.substring(0);

In this case, the syntax will be replaced with:

String combo = customerOrder.substring(0);

Where customerOrder represents the string variables

2. Integer comboNumber =

This is to convert combo from string to integer using parseInt

This is done as follows:

Integer comboNumber = Integer.parseInt(combo);

See attachment for complete code

Simon takes apart a computer and looks at the thin green boards inside. What are these?
A. binary boards
B. database boards
C. input devices
D. circuit boards

Answers

Answer:

These green boards are circuit boards, these are green in color coz they protect the inner copper lining.

A new computer virus attacks a folder consisting of 200 files. Each file gets damaged with probability 0.2 independently of other files. What is the probability that fewer than 50 files will get damaged? g

Answers

Answer:

0.95345

Explanation:

Given that :

Number of files (n) = 200

Probability of getting damaged (p) = 0.2

q = 1 - p = 1 - 0.2 = 0.8

using normal approximation:

Mean (m) = np = 200 * 0.2 = 40

Standard deviation (s) = √n*p*q= √(200 * 0.2 * 0.8) = 5.6568542

P(X < 50)

X = 50 - 0.5 = 49.5

Find the standardized score :

Z = (x - m) / s

Z = (49.5 - 40) / 5.6568542

Z = 9.5 / 5.6568542

Zscore = 1.6793786

P(Z < 1.6793) = 0.95345 ( using Z probability calculator)

How do you insert text into a presentation?

by clicking in a placeholder and entering text
by clicking in the task pane and entering text
by drawing a text box, clicking in it, and entering text
by selecting Text from the Insert menu

Answers

Answer:

Hello your answer is:

clicking in a placeholder and entering text

drawing a text box, clicking in it, and entering text

Explanation:

I did the assignment on edge 2021-2022

Answer: clicking in a placeholder and entering text, and

drawing a text box, clicking in it, and entering text

Other Questions
The Academy for Academic Excellence has just announced their winner for the most successful student in mathematics This student will receive a grant for their college education as well as national recognition for academic excellence in the field of mathematics. The grant will cover $12,177.17 of the cost of school per year for 5 years. If the initial amount is invested into an account over the five years, paying an annual interest rate of 5,5%, and you are to withdraw from this account until the remaining balance after the 5 years is zero dollars, determine the initial amount of the grant. Round your answer to the nearest dollar. a $52,000 c. $60,886 b. $55,200 d. $64,235 LES Martis cat weights 12.37 pounds What is this weight written as a mixed number? The Diary of Anne Frank is commonly read in middle schools across the country. Why do you feel this text is good for young people to read? Provide examples of how you have connected with Anne Frank and her story. Write a response that is at least three to four complete sentences. On a family road trip, Mr. Edwards travels 130 miles in two hours. At this rate, how many miles will he travel in 30 minutes? (watch the time on this one!) Group of answer choices Mnica _____ ocho aos.1. tienes2. tienen3. tiene4. tengo what is 1.24 x 10^ -2 in standard form ? 24. Answer the question in English telling at least 3 uses of the verb Ser. When is it used? 25. Write the forms of the verb ser. Yo ____________________Nosotros ______________________T_____________________El/Ella/Usted___________________Ellos/Ellas/Uds ___________________*Pleas make sure you answer both questions when answering thank you :) 5.-Who _____ that song? * A) did write B) wrote C) did wrote Mr. Duncan earns 75$ a day plus 35$ for each car he sells. if c is his total earnings and x is the number of cars he sold, what is the equation Pls I need help !!!!! why should kids do community service could someone look this one over for me and tell me the answer. i would app it. whats 14 4/10 - 13 1/3 ASAP Determine if the side lengths could form a triangle. Use an inequality to prove your answer.a) 16 m, 21 m, 39 mb) 34 km, 27 km, 58 kmc) 29 ft, 38 ft, 9 ft Which statement describes a finding of Johannes Kepler?The planets circle the Earth.The stars revolve around the Sun.The movements of planets are determined by gravity.O The planets travel faster when they are closer to the Sun. Changes to an environment, such as drought or human activity, can reduce the available resources. What do you predict might happen if resources were to become reduced or unavailable? How can you tell if an email has an attachment? How do you download it? What folder does it download to? According to a survey, 10% of Americans are afraid to fly. Suppose 1100 Americans are sampled. a) What is the probability that 121 or more americans in the survey are afraid to fly Read this quote from "Letter from Birmingham Jail." (p. 204, paragraph 7)"One may well ask, 'How can you advocate breaking some laws and obeying others?' Theanswer lies in the fact that there are two types of laws: just [fair) and unjust unfair). I wouldbe the first to advocate obeying just laws. One has not only a legal but a moral responsibilityto disobey just laws."Which of the following is true? A. This is an example of the use of ethos, because King shows that he is an honest person who is aware of hisresponsibility to be aware of his actions and to do the right thing.B. This is an example of the use of logos, because King demonstrates that he is willing to consider the challenge tohis behavior and defend it by presenting logic.C. This is an example of the use of pathos, because King stirs up sympathy for the obstacles constantly placed in the way of black people due to Jim Crow Laws.D. Either A or BE. Either B or C Which statement summarizes a belief of the Republican Party?A: There should be higher taxes and more public services.B: State and federal elections should be held more frequently.C: There should be lower taxes and less reliance on public services.D:The U.S. House of Representatives is more important than the Senate.