86,680 views
21 votes
21 votes
Need help with this please

4. Declare three variables and give them the names of three common grocery items. Assign to each variable a NUMBER value approximately its price. Don’t use $ sign, just the actual number.

5. Declare another variable, name it total, and assign to it the SUM of the three other variables, using the VARIABLE NAMES, not the value they contain. Hint - you’ll need to use an arithmetic operator to do this.

This is what my assignment looks like in the picture.
It’s for a coding class I’m taking.

I’m just super confused on how to do part B.

Need help with this please 4. Declare three variables and give them the names of three-example-1
User Spielberg
by
2.9k points

1 Answer

8 votes
8 votes

Answer:

4. let eggs = 5

let bread = 10

let soda = 6

5.

let total = eggs+bread+soda

User Vlad Preda
by
2.9k points