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
Daniel [21]
3 years ago
6

Jasmine is writing a shopping app. She has created a variable to keep track of the number of items in the shopping cart. Every t

ime someone clicks the "addItemButton", she would like the variable to increase by 1.
What code should Jasmine insert where it says in order for her app to work?a) cart total = 1;
b) cartTotal + 1;
c) cartTotal = cartTotal +1;
d) var cartTotal = cartTotal + 1;
Computers and Technology
1 answer:
Bas_tet [7]3 years ago
8 0

Answer:

C.     carTotal=carTotal + 1;

Explanation:

Option 'c' is the correct answer, because when some click on the "additembutton" the variable cartTotal should increment by 1. As jasmine want to track the record of no. of items in cart, each time customer will click "additembutton" the variable "cartTotal" increment by 1 and also update the value of that variable. e.g

If initially

cartTotal=0

When 1st time additembutton pressed

CartTotal = CartTotal + 1   ==> will make it as   CartTotal=0+1    ==>  CartTotal = 1

Now CartTotal=1;

When customer 2nd time press "additembutton"

CartTotal = CartTotal + 1   ==> will make it as   CartTotal=1+1    ==> CartTotal = 2

This process will continue and update the cartTotal till the customer add items into the cart.

You might be interested in
Using Sequential Search on an array of size n, the search key is definitely present in the array. The probability of matching th
MissTica

Answer:

(11n-5) / 12 is correct answer.

Explanation:

The Probability that key will match to nth term = 1/2

The Probability that key will match to n-1th term = 1/3

As all other probabilities are equal

The Total Probability that key matches to any of 1 to n-2 index = 1 - 1/2 - 1/3 = 1/6

The Probability that key matches to any of 1 to n-2 index = (1/6) / n-2 = (1/6)* (n-2))

Let P(i) = Probability that key matches to ith index.

The Average time complexity = 22 i=1 P(i) * i

The Average time complexity = 1/(6(n-2) * ( sum of 1 to n-2 ) + (n-1) / 3 + n/2

The Average time complexity = 1/(6(n-2) * ( n-2)*(n-1) / 2 + ( n-1) / 3 + n/2

The Average time complexity = 1/6 * (n-1)/2 + (n-1)/3 + n/2

The Average time complexity = (n-1)/12 + (n-1)/3 + n/2

The Average time complexity = (n-1 + 4 * n - 4 * 1 +6 * n)/12

The Average time complexity = 11n-5 / 12

so (11n-5) / 12 is correct answer.

7 0
3 years ago
Biometric devices are often associated with computer and data security. True False
Leya [2.2K]

Answer:

True

Explanation:

5 0
3 years ago
Unit 7 - Planning and Designing a Website
quester [9]

Am not sure about no.2 and no.4
But am going to answer
1.true
3.true
5.true
8 0
1 year ago
The classification of clouds is based on their _____.
goblinko [34]
Clouds might be ordered by shape and by height. Luke Howard, a British drug specialist was the first to portray cloud shapes utilizing Latin terms, for example, cirrus, cumulus or stratus. The division of mists into ten fundamental cloud structures or cloud genera depends on his productions.
5 0
3 years ago
Read 2 more answers
Zeke used primarily Web sources for his informative speech about gun control. However, his over-reliance on the website sponsore
Andreas93 [3]

Answer:

a. Objectivity

Explanation:

Zeke ignored objectivity as a criteria for evaluating Web sources.

7 0
2 years ago
Other questions:
  • Given a string variable named sentence that has been initialized , write an expression whose value is the the very last characte
    14·1 answer
  • To create an individual version of a slide, you would click
    9·1 answer
  • To select a number format, you can choose a category in the Number tab in the Format Cells dialog box and then select the number
    5·1 answer
  • Smartart and shapes are useful tools because they allow you to
    10·1 answer
  • The adjustable contact of a potentiometer is placed at the center of its adjustment. If the total resistance is 5 kOhms, what is
    9·1 answer
  • Mary is writing an article about the software development life cycle. She wants to place a flowchart besides the text. Which men
    6·2 answers
  • Show the array that results from the following sequence of key insertions using a hashing system under the given conditions: 5,
    12·1 answer
  • Conversion of a continuous stream of sound into a series of ones and zeroes that can be interpreted by computers results in
    12·1 answer
  • A. What is MS-Word ? Write its uses.
    14·2 answers
  • Could you tell me the family link app code to unlock a phone please?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!