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
What are the basic tasks performed by an operating system?​
Kruka [31]

Answer:

An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

Explanation:

i hope it helps:)

3 0
2 years ago
Computer programming
Svet_ta [14]
Sjanqknjwolq esjkalqlkd
5 0
2 years ago
generally, ( mouse,keyboard,hard disk,pen drive) can't be removed from the computer ? choose the correct answer​
artcher [175]

Answer:

Hard Disk

Explanation:

A very important part of a computer is the hard disk. It stores data and documents that users may have downloaded. Removing the hard disk could make the computer useless.

A mouse, keyboard, or pen drive can be easily removed.

A mouse and a pen drive are USB-connected devices and can be removed by simply unplugging the cable. A keyboard can be removed by simply taking off the keycaps. It is easily accessible.

-Chetan K

7 0
2 years ago
Read 2 more answers
A television advertisement claiming that a product is "light-years ahead of its time" does not make sense because (a) it doesn’t
adell [148]

Answer:

B. It uses "Light-years" to talk about time, but a light-year is a unit of distance.

Explanation:

Light-Year is a term used in astronomy to describe the distance that light travels in a year. Informally, astronomers use the light year to describe distances between planets, stars, moons and other astronomical bodies.

Light-years are sometimes mistakenly thought of as units of time — because of the year — but they're actually units of distance, equal to about six trillion miles. In 1851, the light year was first used for defining distances by a German astronomer who compared it to a "hiking hour," or the distance a person can hike in one hour. The term can also figuratively mean "a long way:"

5 0
3 years ago
What will be printed when the method printstuff is called?
abruzzese [7]
Here is the correct answer of the given question above. The one that will be printed when the method printstuff is called is that there will be a compile error because a double cannot be assigned to an int <span>without a cast. Hope this answer helps. </span>
3 0
3 years ago
Other questions:
  • If Chris has a car liability insurance, what damage would he be covered for
    10·1 answer
  • Create a class named Circle with fields named radius, diameter, and area. Include a constructor that sets the radius to 1 and ca
    7·1 answer
  • An identifier that is prefixed with an @ and allows you to use code written in other languages that do not have the same set of
    8·1 answer
  • When creating a chart or graph, which should be completed first?
    9·2 answers
  • Mariah was working on a multimedia presentation that included both video and audio files. The file was huge, and she wanted to s
    13·2 answers
  • Individual internet users connect to isps through a(n ________.
    11·1 answer
  • Strengths and weaknesses about esport
    10·1 answer
  • You have been supporting CSM Tech Publishing's Windows Server 2016 server network for over a year. The office has two Windows Se
    12·1 answer
  • The memory used by the CPU to temporarily hold data while processing is called _______. random access memory central processing
    5·1 answer
  • What does it mean to clear a setting in a dialog box?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!