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
valentinak56 [21]
3 years ago
9

Consider this program segment: int newNum = 0, temp; int num = k; // k is some predefined integer value 0 while (num > 10) {

temp = num % 10; num /= 10; newNum = newNum * 10 + temp; } System.out.println(newNum); Which is a true statement about the segment? I If 100 <= num <= 1000 initially, the final value of newNum must be in the range 10 <= newNum <= 100. II There is no initial value of num that will cause an infinite while loop. III If num <= 10 initially, newNum will have a final value of 0.
Computers and Technology
1 answer:
Doss [256]3 years ago
6 0

Answer:

All of these statements are true.

Explanation:

Since the while loop is reversing the integer number and leaving the highest order digit in the num and stores the reversed number in the newNum variable.

It skips one digit so if the num is in the range of [100,1000] it will result in a number between 10 and 100.

This loop can never go in infinite loop for any initial value of num because the loop will run as many times as the number of digits.

and if the value of the num is <=10 the while loop will never run and the value of newNum will be 0.

You might be interested in
Whats a computer scientist.
Kazeer [188]

Answer:

computer scientist is a person who has acquired the knowledge of computer science, the study of the theoretical foundations of information and computation and their application.

4 0
2 years ago
Read 2 more answers
What is the magnitude of the largest positive value you can place in a bool? a char? an int? a float?
MaRussiya [10]

Answer:

A bool can hold only true or false values.

A char can hold maximum 65535 characters.

An int can hold maximum positive value of 2,147,483,647.

A float can hold maximum positive value of 3.4 x 10^{38}.

Explanation:

Primitive data types in Java language can be categorized into boolean and numeric data types.

Numeric can be divided further into floating point and integral type. Floating data type includes float and double values while and integral data type which consists of char, int, short, long and byte data types.

Every data type has a range of values it can hold, i.e., every data type has a minimum and maximum predefined value which it is allowed to hold. The intermediate values fall in the range of that particular data type.

Any value outside the range of that particular data type will not compile and an error message will be displayed.

The data types commonly used in programming are boolean, char, int and float.

A boolean variable can have only two values, true or false.

A char variable can hold from 0 to 65535 characters. Maximum, 65535 characters are allowed in a character variable. At the minimum, a char variable will have no characters or it will be a null char variable, having no value.

An int variable has the range from minimum -2^{31} to maximum 2^{31} – 1. Hence, the maximum positive value an int variable can hold is (2^{31}) – 1.

A float variable can hold minimum value of 1.4 x 10^{-45} and maximum positive value of 3.4 x 10^{38}.

The above description relates to the data types and their respective range of values in Java language.

The values for boolean variable remain the same across all programming languages.

The range of values for char, int and float data types are different in other languages.

7 0
2 years ago
Any please answer this How much resistance is required to gen-erate 50 mA of current from a 5 volt bat-tery?
nasty-shy [4]

Answer:

Calculating Currents: Current in a Truck Battery and a Handheld Calculator ... (b) How long does it take 1.00 C of charge to flow through a handheld calculator if a 0.300-mA current is ...

7 0
2 years ago
A person clicks on an ad of a fitness club in a blog on nutrition. The person conducts a search on yoga and moves to another web
Sloan [31]

Answer: the answer is B.

hope this help

3 0
3 years ago
Examples of domain names and usernames<br><br><br><br>​
svp [43]

Answer:

examples are:

com or .edu is a top-level domain name (TLD)

cornell.edu is a second-level domain name (SLD)

bigred.cornell.edu is a third-level or three-part domain name

project.bigred.cornell.edu is a fourth-level or four-part domain name

hope this helps you.

4 0
2 years ago
Other questions:
  • Which activity constitutes legal computer activity?
    12·1 answer
  • Forms are used to a provide a more user-friendly way to work with data in tables
    14·1 answer
  • How can i complain a rude comment
    7·1 answer
  • A type of wireless local area network technology​
    7·2 answers
  • Visual culture is an area of academic study that deals with the totality of images and visual objects produced in ____________,
    6·1 answer
  • What is the term for an understanding about the processes that underlie memory, which emerges and improves during middle childho
    7·2 answers
  • What term is used to refer to the merging of government services with information technology?
    11·1 answer
  • when files on storage are scattered throughout different disks or different parts of a disk, what is it called
    10·1 answer
  • State the functions of the parts of the computer​
    11·2 answers
  • What are tasks performed by pascaline?​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!