I have spent a couple hours trying to figure out why this comes back as 0 If someone could help that would be great.
1 /*Written by Connor Green*/
2 /*CISP 1
That's because you calculate number_of_omelettes
before getting the input variables for this calculation. Move that calculation to just before outputting it:
...
number_of_omelettes = carton_size * number_cartons / eggs_per_omelette;
cout << "You can make " << number_of_omelettes << " omelettes with this amount of eggs.\n";
Also, beware that the division /
operator precedes the multiplication *
operator, which could result in zero due to integer division. To avoid this, force the multiplication to precede the division, using parentheses:
number_of_omelettes = (carton_size * number_cartons) / eggs_per_omelette;