Question: Practice 7 Create a variable called totalSnacks and set it equal to 5 0 . Create a variable called numberOfHungryFriends and set it equal to

Practice 7
Create a variable called totalSnacks and set it equal to 50. Create a variable called numberOfHungryFriends and set it equal to 6. Now make a variable called
snacksPerPerson and set it equal to 3. Create a constant called remainingSnacks and set it equal to totalSnacks minus numberOfHungryFriends times snacksPerPerson.
Print remainingSnacks.
Practice 8
Create a constant called splitItUp and set it equal to remainingSnacks divided by numberOfFriends. Print splitItUp. Is the number accurate? What happens if you change
the data types to Double?
Practice 7 Create a variable called totalSnacks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!