After the code that follows is executed, what is the value of discountAmount?
var discountAmount;
var orderTotal = 200;
if (orderTotal > 200) {
discountAmount = orderTotal * .3;
} else if (orderTotal > 100) {
discountAmount = orderTotal * .2;
} else {
discountAmount = orderTotal * .1;
}

Answers

Answer 1

An integer variable is defined and assigned an initial value of [tex]200[/tex].

There is an if-else block in the next part of the code. In the first part, a condition is defined in case the value of the defined variable is greater than [tex]200[/tex]. But since the value of our variable is [tex]200[/tex], we will proceed to the next block.

Since the value of our variable is greater than [tex]100[/tex], we will follow the commands in the second block.

The expression [tex].2[/tex] means multiplying the current number by [tex]0.2[/tex].

Therefore, we will multiply [tex]200[/tex] by [tex]0.2[/tex].

The program output will be therefore as [tex]40[/tex].

Related Questions

QUICK HELP PLEASE DUE IN 10 MIN!

HELP!
What is a central processing unit? Select two options.

the electronic circuitry that receives data and transforms it to human-readable form


the electronic circuitry that stores data and instructions so they can be processed


the electronic circuitry that handles all the instructions it receives from hardware


the electronic circuitry that stores information for immediate use by software


the electronic circuitry that handles all the instructions it receives from software

Answers

It is to be noted that a central processing unit is;

the electronic circuitry that handles all the instructions it receives from hardware; (Option C)the electronic circuitry that handles all the instructions it receives from software. (Option E)

What is the purpose of the central processing unit?

The central processing unit (CPU) directs the computer through the many processes of problem resolution.

Information enters the computer through an input unit, is analyzed by the central processing unit, and then outputs to the user via an output unit.

The CPU executes fundamental arithmetic, logic, controlling, and input/output (I/O) activities provided by program instructions. This is in contrast to external components like main memory and I/O circuits, as well as specialized processors like graphics processing units (GPUs).

Learn more about central processing units:

https://brainly.com/question/4558917

#SPJ1

Answer:

C and E

Explanation:

4. Some programs add extra characters,
called a(n)________, to
a file name.

Answers

Answer:

big letters

Explanation:

in order for the file to be more impacable

PLEASE FILL IN THE BLANK

With a bit depth of __ I can support 8 grayscale variations of black and white images.

Answers

Answer:   Thre correct answer is 3 bit

Explanation:

Using binary, a 3-bit value can support 8 variations in grayscale:

1   000

2   001

3   010

4   011

5   100

6   101

7   110

8   111

Please help

Which action is not following the rules of netiquette?
A) Be respectful of human feelings and emotions.
B) Use proper grammar and spelling.
C) Avoid engaging in a negative way.
D) Use acronyms to make typing more efficient.

Answers

An action which does not follow the rules of netiquette is: D) Use acronyms to make typing more efficient.

What is netiquette?

Netiquette is a short terminology for network etiquette or Internet etiquette and it can be defined as the set of behaviors, rules, proper manners, and customs that are considered to be polite (courteous) and should be followed by end users, especially when they are communicating through the use of an email, computer technology, and social media over the Internet.

This ultimately implies that, netiquette simply refers to the acceptable or correct way of using the Internet for respectful, polite (courteous) and appropriate communication.

In this context, we can reasonably infer and logically deduce that making use of acronyms or abbreviations does not follow the rules of netiquette.

Read more on netiquette here: https://brainly.com/question/27372890

#SPJ1

The process of preparing a floppy diskette for use is called_____?
A. process

B. data

C. byte

D. bit

Answers

The process of preparing a floppy diskette for use is called Formatting.

The given program reads a list of single-word first names and ages (ending with -1), and outputs that list with the age incremented. The program fails and throws an exception if the second input on a line is a string rather than an integer. At FIXME in the code, add try and except blocks to catch the ValueError exception and output 0 for the age.




Ex: If the input is:


Lee 18

Lua 21

Mary Beth 19

Stu 33

-1

then the output is:


Lee 19

Lua 22

Mary 0

Stu 34



# Split input into 2 parts: name and age
parts = input().split()
name = parts[0]
while name != '-1':
# FIXME: The following line will throw ValueError exception.
# Insert try/except blocks to catch the exception.
try:
age = int (parts [ 1 ]) + 1
print('{ }{ }'.format(name, age))
# Get next line
parts = input().split()
name = parts[0]
except ValueError:
print ('Invalid value!')
# Get next line
parts = input().split()
name = parts[0]

Answers

Using the knowledge of computational language in python it is possible to write a code that program reads a list of single-word first names and ages (ending with -1), and outputs that list with the age incremented.

Writting the code:

# Split input into 2 parts: name and age

parts = input().split()

name = parts[0]

while name != '-1':

   # Insert try/except blocks to catch the exception.

   try:

       age = int(parts[1]) + 1

       

       # printing name and age

       print('{} {}'.format(name, age))

   

   except ValueError:

       # printing name and age as 0

       print('{} {}'.format(name, 0))

   

   # Get next line

   parts = input().split()

   name = parts[0]

See more about python at brainly.com/question/18502436

#SPJ1

Dr. Bloom is writing a test for a history class and wants to ask a question that will have a Boolean value for the answer. Which of these should Dr. Bloom
use?
O A
OB.
OC.
O D. true-false questions
essay questions
short-answer questions
multiple choice questions
Reset
Next

Answers

D. true-false question

Answer:

O A

It should be the right answer!

This is the building which spy uses for information transmission.
He use the opened and closed windows for encoding the secret password. The code he
uses is ASCII. What is the password? HELPPPPP

Answers

Based on the given question that a spy stays in a building and transmits information using the opened and closed windows for encoding the secret password which he uses in ASCII, the password is 01.

Step by step explanations

Step 1

In digital electronics, the information is processed in form of binary data either 0 or 1.

This binary data 0 or 1 is known as Bit. To turn on the switch binary data used is 1 and binary data 0 is used for the turn off.

A byte is a combination of 4 bits. Here only the switch is turned on and turned off. Hence, the system processed the information in terms of the Bit.

What is ASCII?

This refers to the acronym that means American Standard Code for Information Interchange and is a character encoding standard for electronic communication.

Read more about ASCII here:

https://brainly.com/question/13143401

#SPJ1

What is output if the user types in 7? Click all that apply.

Answers

Based on the code that is given below, the output if the user types in 8 is option C:  C.

What is the line of code about?

The code above is an if statement: A will not be printed since the user had specified x = 8, which does not satisfy the criterion x!= 8 (!= stands for not equal).

Since x must be greater than or equal to 10 in order to satisfy the criterion for "B" to be printed, "B" will not be printed because x does not meet the condition.

Also x is less than 10, the requirement of x10 is satisfied, and "C" will be printed as a result.

Learn more about coding from

https://brainly.com/question/20312196

#SPJ1

See correct question below

x = int (input ("Enter a number: "))

if (x != 8):

print ("A")

if (x >= 10):

print ("B")

if (x < 10):

print ("C")

if (x % 2 == 1):

print ("D")

What is output if the user types in 8? Click all that apply.

A

B

C

D

Other Questions
Using the information from the document above, and your knowledge of US History, complete the following assignment: SOMEONE CREATE THE POSTER PLS Create a poster encouraging unity and cooperation between the colonial governments of individual colonies prior to the start of the French and Indian War. Show the advantages of unity and cooperationShow the disadvantages of colonial governments not cooperating Argue for unity and cooperation amongst the colonies A ball is dropped from a height of 1600 meters. Each time the ban bouces, it reaches 3/4 of its original height. a) What are the first three terms of this sequence? b) Write an equation to represent this Sequence. c) Find the height of the ball after 4 bounces. 1Jane bought a car for 240002 years later she sold it for 26000Work out her percentage profit to 1decimal place The war started in 1914 and ended in 1918. Technological advances in killing included the use of.A. RPGs (Rocket Propelled Grenades)B. Nuclear MissilesC. Poison GashD. TasersE. a hydrogen bomb Correct these sentences. 1. he gived i a choice between hamburgers or hot dogs for lunch 2. the book the giving tree by shel silverstein is checked out Give two words that rhyme with each of the following words. 3. return______________ _______________ 4. learn______________ _______________ Synonyms, antonyms, or homophones? 5. weather, whether_____________________ determine which items of personal protective equipment (ppe) you will likely use in a general chemistry lab. 10. Determine whether the question can be answered using permutations or combinations.Explain your choice then answer the question. (3 points each)a.On a sailboat there are 6 signal flags. The order the flags are strung on the mastdetermines the signal being sent. How many 3-flag signals can the captain send?b. You are taking an online geometry quiz in which 6 questions are randomly selected froma test bank of 50 questions. How many versions of the quiz are possible? Learning Log9-11-20Provide a complete written response to the prompts. You must include any graphs or sketchesthat apply1. Explain how the points of intersection of graphs of functions can be determined (orverified) using the multiple representations of a system of equations. Provide examples anda sketch.I A british avro vulcan bomber is hijacked for its nuclear bombs by the criminal organization spectre in which 1960s james bond movie?. Evaluate. Write your answer as an integer or as a decimal rounded to the nearest hundredth. cos 12 = ____ Analysis of data: Answer the following using the equation Force = Mass xAcceleration:1. The cruise control feature on most cars allows the engine to provide just the right amount offorce to maintain a constant speed. If the engine is applying force to the mass of the car, whydoesn't the car accelerate?17 Hi please help me thanks! What does the narrator mean when she says that silence surrounds them like a cloak? cyanide binds strongly with the last electron carrier in the chain. how would this affect the flow of electrons? A right triangle has vertices P(-2,5), Q(5,2) and R(8,9). Whatare the coordinates of the midpoint of the hypotenuse? Find the kissing side round your answer to the nearest tenth An elevator ascends at a rate of 29.6 feet per second. If a building is 1,450 feet tall,about how long would it take for the elevator to travel from the ground floor to the roof?OA. 0.49 minuteO B. 0.82 minuteOC. 4.9 minutesOD. 8.2 minutes NEED THIS ASAP 50 POINTS UWUWhich property of equality should you apply to keep the equation 22 . a = 242 in balance when solving?The division property of equalityThe subtraction property of equalityThe reflexive propertyThe substitution property of equality Think about a lake. Would you describe it as a homogeneous mixture, a heterogeneous mixture, or both? Explain. Greer industries and hanson incorporated are both computer manufacturing companies. Greer uses the jit inventory method, whereas hanson uses the traditional inventory method. How do greers inventory levels differ from hansons?.