Question: This was written in C++ I need help trying to get a calculator running.I'm going to try my best to explain it. So each pizza

This was written in C++

I need help trying to get a calculator running.I'm going to try my best to explain it. So each pizza box has 12 slices in it.(In this assignment) My problem is that I cant find a way to make my code understand that every pizza box is equal to 12 slices. So for example, if I have 6 guests and according to my code. Each of them will eat 3 slices. So, my code has to show that I will need to order 2 boxes of pizza not 1 and a half, which is why i rounded it so it can lean towards the higher number.

#include #include

int main() { double taxes; double subtotal; double subtotaltax; double pizzacosts; double numberofpizzasneeded; double totalwithtaxes; double pizza; int people; int SlicesPP;

pizzacosts = 12.95; SlicesPP = 3; taxes = 0.0825;

std::cout << "******************** "; std::cout << "* PIZZA CALCULATOR * "; std::cout << "******************** ";

std::cout << " How many people will be eating pizza today? "; std::cin >> people;

pizza = (people * SlicesPP) / 3; numberofpizzasneeded = round(pizza); subtotal = pizzacosts * pizza; totalwithtaxes = (subtotal * taxes) + subtotal; std::cout << "The number of pizzas needed: " << numberofpizzasneeded << " "; std::cout << "Subtotal: " <

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 Databases Questions!