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
Kamila [148]
3 years ago
12

What does the following if statement do? if (num1 == Math.abs(num1))

Computers and Technology
1 answer:
Gennadij [26K]3 years ago
6 0

This statement checks if num1 is equal to the absolute value of num1

For instance,

num1 = 4 and the absolute value of num1 = 4. This would run the code inside the if statement but if num1 = -1 the absolute value of num1 = 1 and the if stamtent would be skipped because -1 does not equal 1

You might be interested in
Write a recursive method to compute the following series: 1 + 1/2 + 1/3 + 1/i ... Write a test program that displays m(i) for i
White raven [17]

We will assume that i / 1 is constant and i express i = 1 / n while n = 1,2,3,4,5,6,7 ..

8 0
3 years ago
Assume that you want to create an array containing ten Die objects. Which of the following code segment accomplishes this correc
V125BC [204]

Answer: A

To create an array containing 10 die object we have:

Die[]dice=new die[10]; for (int I=0; i<dice,length; i++){dice[I]=new die();}

8 0
4 years ago
Interpretation is adding meaning to information by making connections and comparisons and by exploring causes and consequences.
Papessa [141]

Answer: True

Explanation: Interpretation is the way of finding about the conclusion or outcomes and tracing the relationships. Interpretation is based on the finding the conclusion based on the responses gained and observing the relationship that is being established.

It also works for finding the reason behind the result and comparison is done on the basis of the results achieved.Therefore, the given statement is true.

7 0
3 years ago
Write a program that allows the user to input a total dollar amount for an online shopping order and computes and outputs the sh
tia_tia [17]

The program written in python 3 which prints the shipping cost based on the total shopping cost is written thus :

cost = int(input('Enter your shopping cost : '))

<em>#accepts</em><em> </em><em>integer</em><em> </em><em>input</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>customer's</em><em> </em><em>shopping</em><em> </em><em>cost</em><em> </em>

if cost < 50 :

print('ship within USA : $6 ')

print('ship to canada : $8')

<em>#if</em><em> </em><em>cost</em><em> </em><em>of</em><em> </em><em>shopping</em><em> </em><em>is</em><em> </em><em>below</em><em> </em><em>$</em><em>50</em><em>,</em><em> </em><em>shopping</em><em> </em><em>to</em><em> </em><em>USA</em><em> </em><em>is</em><em> </em><em>$</em><em>6</em><em> </em><em>and</em><em> </em><em>Canada</em><em> </em><em>$</em><em>8</em>

elif (cost >=50) & (cost < 100):

print('ship within USA : $9 ')

print('ship to canada : $12')

<em>#if cost of shopping is between $50 and below $100, shopping to USA is $9 and Canada $12</em>

elif (cost>=100) & (cost < 150):

print('ship within USA : $12')

print('ship to canada : $15')

<em>#if cost of shopping is between $</em><em>100</em><em> </em><em>and below $</em><em>150</em><em>, shopping to USA is $</em><em>12</em><em> and Canada $</em><em>15</em>

elif cost > 150 :

print('ship within USA : Free')

print('ship to canada : Free')

<em>#if cost of shopping is above $150 ; then shipping cost is free to both countries. </em>

Learn more :brainly.com/question/24847242

5 0
2 years ago
What can a user modify on a business card using the Edit Business card in the dialog box?​
AysviL [449]
Answer: layout,image,font,background color,
6 0
3 years ago
Other questions:
  • The original U.S. income tax of 1913 was quite simple. The tax was
    10·1 answer
  • What is a pin? part of a connector a port part of a cable a NIC
    14·1 answer
  • How is the illusion of animation achieved using Sprites with multiple costumes?
    12·1 answer
  • Why transport layer is usingconnectionless services if network layer is providing connection oriented services?
    10·1 answer
  • Summarise all what you know about spss​
    15·1 answer
  • Please help me with this , I’m stuck and cannot understand this , please help me with this , I’ll appreciate it alot
    13·1 answer
  • What is the first step in finding a solution to a problem? Choose a solution. Think of options to solve the problem. Try the sol
    6·1 answer
  • Question 2 (6 points)
    11·1 answer
  • Which tool ia used to create the world wide web?
    15·1 answer
  • Advantages and disadvantages of a watch tower​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!