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
Mashutka [201]
3 years ago
6

Int var1 = 0b0001; int var2 = 0b1111; int results1 = var1 & var2; int results2 = var1 | var2; int results3 = var1 ^ var2; in

t printit = results1 + results2 + results3; what are the values for results1, results2, results3 and printit after executing the code?
Mathematics
1 answer:
Afina-wow [57]3 years ago
8 0
<span>Int var1 = 0b0001;
int var2 = 0b1111;
int results1 = var1 & var2;
int results2 = var1 | var2;
int results3 = var1 ^ var2;
int printit = results1 + results2 + results3;
 
what are the values for results1, results2, results3 and printit after executing the code?
notes:
1. faster responses will be obtained if your code is presented line by line (in a file) before posting.
2. please specify language, many languages use the same syntax but could have differences in interpretation
-------------------------------------------------------------------------------

Assuming Java as the language.  C is similar.
</span><span><span>& bitwise AND &
^ </span><span>bitwise exclusive OR
</span><span>| bitwise inclusive OR

So 
results1=var1&var2=0b0001&0b1111=0b0001
results2=var1|var2=0b0001&0b1111=0b1111
results3=var1^var2=0b0001&0b1111=0b1110
printit=results1+results2+results3=0b0001+0b1111+0b1110
=0b10000+0b1110
=0b11110   

Note: by default, int has 4 signed bytes, ranging from decimal -2147483648 to +2147483647
</span></span>
You might be interested in
You are a contractor and charge $45 for a site visit plus an additional $24 per hour for each hour you spend working at the site
tino4ka555 [31]

Answer:

Equation: 810= (90 + 24y)

y = 30 hours

Step-by-step explanation:

Given:

Site visit = $45 per site

cost per hour worked = $24

for <u>each </u>work site, the total amount of money earned

= site visit fee + cost for working

But the question mentions TWO sites, hence there will be two site visits. Therefore for TWO sites, we have to account for TWO site visit fee.

Therefore for TWO sites, the total amount of money earned

= site 1 visit fee + site 2 visit fee + cost for working

= (2 x site visit fee) +  cost for working  ------ Equation 1

We are further given that we worked y hours at the hourly work rate of $24 per hour.

Hence the cost for working

= y hours x hourly rate

= y   x   $24

= $24y   (substituting this into equation 1 above)

for TWO sites, the total amount of money earned

= (2 x site visit fee) +  cost for working

= (2 x $45) +  $24y

= $90 + $24y

= $(90 + 24y)

We are also given that we have to earn $810 for two sites, hence

810 = 90 + 24y    

810 - 90 = 24y

24y = 720

y = 720/24

y = 30 hours

8 0
3 years ago
60 = −2(−10 − 4x)<br> what is the answer show step by step
Papessa [141]
That’s the answer with steps

8 0
3 years ago
Read 2 more answers
Find an equation of the line passing through the given points (1,-3) and (3,3)
chubhunter [2.5K]

ANSWER: y= 3x - 6

STEP-BY-STEP EXPLANATION:

(1,-3) and (3,3)

X1=1           X2=3

Y1= - 3       Y2=3

1) Find the slope of the line.

To find the slope of the line passing through these two points we need to use the slope  formula:

m = \frac{Y2-Y1}{X2-X1}

m= \frac{3-(-3)}{3-1}   m=\frac{6}{2} = 3

2)Use the slope to find the y-intercept.

Now that we know the slope of the line is 3 we can plug the slope into the equation and  we get:

y= 3x+b

Next choose one of the two point to plug in for the values of x and y. It does not matter  which one of the two points you choose because you should get the same answer in either  case. I generally just choose the first point listed so I don’t have to worry about which  one I should choose.

y= 3x+b       point (1,-3)

-3= 3(1) + b

-3-3=b

-6=b

3)Write the answer.

Using the slope of 3 and the y-intercept of -6 the answer is:

y = 3x - 6

6 0
3 years ago
Simplify 5x - 7x - 8x +4
KonstantinChe [14]
-10x+4.
5x-7x is -2.
-2x-8x is -10x.
you cannot simplify the 4

alternatively, you could write -10x+4 as
-2(5x-2)
7 0
3 years ago
Help I don’t understand at all
zloy xaker [14]

Answer:

1)\ \ 4h^2-13h+6\\2)\ \ 7x^3y^2-x^2y+1\\3)\ \ -7n+2\\4)\ \ -8m+4

Step-by-step explanation:

1.

Simplify the expression by combining like terms. Remember, like terms have the same variable part, to simplify these terms, one performs operations between the coefficients. Please note that a variable with an exponent is not the same as a variable without the exponent. A term with no variable part is referred to as a constant, constants are like terms.

2h^2-7h+2h^2-h+6+4h-9h

(2h^2+2h^2)+(-7h-h+4h-9h)+(6)

4h^2-13h+6

2.

Use a very similar method to solve this problem as used in the first. Please note that all of the rules mentioned in the first problem also apply to this problem; for that matter, the rules mentioned in the first problem generally apply to any pre-algebra problem.

8x^3y^2-7x^2y+8x-4-x^3y^2+2x^2y+4x^2y-8x+5

(8x^3y^2-x^3y^2)+(-7x^2y+2x^2y+4x^2y)+(8x-8x)+(-4+5)

7x^3y^2-x^2y+1

3.

Use the same rules as applied in the first problem. Also, keep the distributive property in mind. In simple terms, the distributive property states the following (a(b+c)=(a)(b)+(a)(c)=ab+ac). Also note, a term raised to an exponent is equal to the term times itself the number of times the exponent indicates. In the event that the term raised to an exponent is a constant, one can simplify it. Apply these properties here,

-2(8n+1)-(5-9n)+3^2

-2(8n+1)-(5-9n)+(3*3)

-2(8n+1)-(5-9n)+9

(-2)(8n)+(-2)(1)+(-)(5)+(-)(-9n)+9

-16n-2-5+9n+9

(-16n+9n)+(-2-5+9)

-7n+2

4.

The same method used to solve problem (3) can be applied to this problem.

\frac{1}{2}(10-8m+6m^2)-(3m^2+4m-7)-2^3

\frac{1}{2}(10-8m+6m^2)-(3m^2+4m-7)-(2)(2)(2)

(\frac{1}{2})(10)+(\frac{1}{2})(-8m)+(\frac{1}{2})(6m^2})+(-)(3m^2)+(-1)(4m)+(-1)(-7)-8

5-4m+3m^2-3m^2-4m+7-8

(-3m^2-3m^2)+(-4m-4m)+(5+7-8)

-8m+4

8 0
3 years ago
Other questions:
  • More help with math guys, I need all the help i can get
    7·1 answer
  • Which are the coordinates of the vertices of a triangle congruent to ΔPQR?
    15·2 answers
  • two parallel lines are cut by two transversal segments which intersect in the interior of the parallel lines. if this intersecti
    8·1 answer
  • Pllssss help what is 717 divided by 9 and 85 divided 8 and 200 divided by 5 please and I need an answer today
    7·1 answer
  • PLEASE HELP ASAP THANKS
    13·1 answer
  • HELP WILL GIVE BRAINLIEST
    15·2 answers
  • Which step did Craig do incorrectly?<br> A Step 1<br> B<br> C<br> Step 2<br> Step 3<br> Step 4<br> D
    7·1 answer
  • Help 8th grade math really need help to pass this test
    5·2 answers
  • NEED HELP ASAP
    7·1 answer
  • Expand 5(2x-4) please please
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!