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
alex41 [277]
3 years ago
14

Give the type and value of each result of the following Java expressions.

Computers and Technology
1 answer:
atroni [7]3 years ago
3 0
Give the type and value of each result of the following Java expressions. a. (5 / 2) * 2.0  type is float value is 4.0 b. (5/2.0) * 2 type is integer value is 5c. "1.3" + "5.2" type is string value is 1.35.2d. 1 + 7.0 + "2" + "x"  this will produce an error because we cannot add variables of different type
You might be interested in
Please help with my Python code - Functions
valentinak56 [21]

Answer:

Explanation:

see attached for help

4 0
3 years ago
ONLY ANSWER IF YOU KNOW HOW TO WRITE THIS CODE
denis-greek [22]

Answer:

WRITE THIS CODE

WRITE

WRITE

8 0
3 years ago
Read 2 more answers
Please answer........
Vitek1552 [10]

Using the try-except statement, the fix is as follows:

while True:

   try:

       boxes = int(input("How many boxes do you have?"))

       sweaters = int(input("How many sweaters do you have?"))

       break

   except:

       print("Input invalid")

sweatersPerBox = sweaters/boxes

print("You need to put",sweatersPerBox,"sweaters in each box")

<h3>How to prevent the program from crashing?</h3>

The program is given as:

boxes = int(input("How many boxes do you have?"))

sweaters = int(input("How many sweaters do you have?"))

sweatersPerBox = sweaters/boxes

print("You need to put",sweatersPerBox,"sweaters in each box")

The above program would crash when the user enters string inputs.

Examples of string inputs are "7h", "bh"...

One way to fix the error is the use of the try-except statement.

Using the try-except statement, the fix is as follows:

while True:

   try:

       boxes = int(input("How many boxes do you have?"))

       sweaters = int(input("How many sweaters do you have?"))

       break

   except:

       print("Input invalid")

sweatersPerBox = sweaters/boxes

print("You need to put",sweatersPerBox,"sweaters in each box")

The above program would continue running until the user enters a valid input

Another way is to end the program when the user enters string inputs

Read more about python programs at:

brainly.com/question/26497128

#SPJ1

7 0
2 years ago
What are ways to switch windows in Excel? Check all that apply. On the status bar, click the Windows button, and then click the
yulyashka [42]

On the status bar,Windows button, and then click the file name.click to display the Excel jump list, and then click the file name. On the View tab, in the Window group, click Switch Windows, and then click the file name. and also hint you can do alt tab  but alt first and then tab

8 0
3 years ago
Which for loop will iterate 100 times? Group of answer choices for (i = 0; i &lt; 99; i++) for (i = 1; i &lt; 99; i++) for (i =
cupoosta [38]

Answer:

for (i = 0; i < 100; i++);

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Type the correct answer in the box. Spell all words correctly.
    9·1 answer
  • If you wanna buy a Monitor, please explain why you wanna buy it! PLEASE HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!
    9·1 answer
  • Which of the following are possible ways to
    6·2 answers
  • ???????????????????????​
    10·1 answer
  • 4. Write an interface ObjectWithTwoParameters which has a method specification: double area (double d1, double d2) which returns
    9·1 answer
  • . Which one of the following is not a JAD participant? 1. Managers 2. System analyst 3. Business development manager 4. Users
    7·1 answer
  • Why is the term RAW image file generally used to describe a variety of file formats, which are sometimes known as digital raw ca
    13·1 answer
  • In what situation is a read receipt notification not sent when an email is opened or previewed bya recipient?
    8·2 answers
  • Manuel is recording a macro and made a mistake. What is the best option for addressing this situation? O Pause and rewind the ma
    11·2 answers
  • The Ingenuity and the MOXIE are two new pieces of technology on the Perseverance. What role will these instruments play? How wil
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!