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
Simora [160]
3 years ago
15

What is the value of the cost variable after the following code snippet is executed? int cost = 82; if (cost < 100) { cost =

cost + 10; } if (cost > 50) { cost = cost * 2; } if (cost < 100) { cost = cost - 20; }
Computers and Technology
1 answer:
KonstantinChe [14]3 years ago
8 0

Answer:

184

Explanation:

Given the codes

  1.        int cost = 82;
  2.        if (cost < 100)
  3.        {
  4.            cost = cost + 10;
  5.        }
  6.        if (cost > 50)
  7.        {
  8.            cost = cost * 2;
  9.        }
  10.        if (cost < 100)
  11.        {
  12.            cost = cost - 20;
  13.        }

The initial value of cost is 82.

The if condition in Line 3 will pass and therefore cost = 82 + 10 = 92

The if condition in Line 8 will pass and therefore cost = 92 * 2 = 184

The if condition in Line 13 will fail l and therefore the if block will be skipped.

At last, the we get cost = 184.

You might be interested in
_________ involves connecting geographically remote computers into a single network and combining the computational power of all
galben [10]

Answer:

Grid computing involves connecting geographically remote computers into a single network to create a computational grid that combines the computing power of all the computers on the network to attack large computing problems.

7 0
3 years ago
Read 2 more answers
The _______ command was developed by nicholas harbour of the defense computer forensics laboratory.
Lena [83]
Hi! The answer is dcfldd
3 0
3 years ago
⚠️⚠️⚠️⚠️⚠️⚠️Help! What is not an advantage of using virtual machines?
Luda [366]

Answer:

It doesn’t take up any storage space on the physical machine.

Explanation:

The virtual machine does take up some storage space on the physical machine.

5 0
3 years ago
Hi guys how are you i have a question why does people delete questions and answer from brainly and where is the delete option?
Sphinxa [80]
There is no delete option sorry
3 0
3 years ago
Read 2 more answers
I will give brainliest!!!!! I NEED HELP ASAP!!!!!!!
klemol [59]

Answer:

I'm pretty sure it's the first answer.

4 0
3 years ago
Other questions:
  • Can someone show me a image of this completed I will mark brainliest!!! It's typing.com
    11·1 answer
  • one business rule is that each project has one manager. Identify two (and no more than two) problems with the data structure or
    9·1 answer
  • has anyone noticed that brainly has been giving the wrong answers and that the ads are blocking answers or is that just me?
    7·2 answers
  • Nadia has inserted an image into a Word document and now would like to resize the image to fit the document better. What is the
    6·1 answer
  • 1) Discuss when it is best to use indexes. ​
    6·1 answer
  • What is the average time a caller waits for an operator to answer?
    7·1 answer
  • How does one award the brainliest???? will give brainliest.
    8·2 answers
  • 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
  • One purpose of fairy tales is to help children master the problems associated with growing up. Please select the best answer fro
    5·2 answers
  • Create a set of functions that compute the mean, median, and mode of a set of
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!