subject

A drink costs 2 dollars. A taco costs 5 dollars. Given the number of each, compute total cost and assign to totalCost. Ex: 2 drinks and 3 tacos yields totalCost of 19. int drinkCount = 4, tacoCount = 6;
// std::cin>>drinks >> tacos; // you may read values from input stream
int drinkCost = 2, tacoCost = 4;
int totalCost = drinkCount * drinkCost + tacoCount * tacoCost ;
// std::cout << totalCost; // you may want print total cost

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 25.06.2019 02:30
How to delete a question in
Answers: 2
question
Computers and Technology, 25.06.2019 03:00
Match the categories in the first column with examples in the second column. 1. good for watching movies 2. maximum power with small size 3. older style mobile devices that may or may not have internet connectivity tablet computer a.)pda b.)smart phone c.)tablet computer
Answers: 1
question
Computers and Technology, 25.06.2019 06:20
Horseback riders, bicyclists, and skateboarders the rules of right-of-way when they use the road ?
Answers: 1
question
Computers and Technology, 25.06.2019 08:00
Ais the hardware where the data is actually stored.
Answers: 1
You know the right answer?
A drink costs 2 dollars. A taco costs 5 dollars. Given the number of each, compute total cost and as...
Questions
question
Mathematics, 30.04.2021 04:40
question
History, 30.04.2021 04:40
question
Mathematics, 30.04.2021 04:40
Questions on the website: 13722367