Guest User

Untitled

a guest
Nov 23rd, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. float number_of_pies, cups_of_flour, tbsp_of_sugar, tbsp_of_salt, cups_of_butter, large_eggs;
  7. float one_pie, new_recipe, flour_for_one, sugar_for_one, salt_for_one, butter_for_one, eggs_for_one;
  8.  
  9. //number of pies
  10. cout << "Welcome to Malachi's Pie Shop.\n";
  11. cout << "How many pies do you wish to make? ";
  12. cin >> number_of_pies;
  13.  
  14. //recipe for 6 pies
  15. cups_of_flour = 15;
  16. tbsp_of_sugar = 8;
  17. tbsp_of_salt = 3;
  18. cups_of_butter = 5.25;
  19. large_eggs = 6;
  20.  
  21. //recipe for 1 pie (im trying so hard to make this work)
  22. flour_for_one = cups_of_flour / 6;
  23. sugar_for_one = tbsp_of_sugar / 6;
  24. salt_for_one = tbsp_of_salt / 6;
  25. butter_for_one = cups_of_butter / 6;
  26. eggs_for_one = large_eggs / 6;
  27. one_pie = flour_for_one + sugar_for_one + salt_for_one + butter_for_one + eggs_for_one;
  28.  
  29. //recipe for number_of_pies (struggling)
  30. new_recipe = one_pie * number_of_pies;
  31.  
  32. //returning info to user
  33. cout << "Now making " << number_of_pies << " pies.\n" << endl;
  34.  
  35. //displaying new recipe
  36. cout << "Cups of Flour - " << flour_for_one * number_of_pies << endl;
  37. cout << "Tablespoons of Sugar - " << sugar_for_one * number_of_pies << endl;
  38. cout << "Tablespoons of Salt - " << salt_for_one * number_of_pies << endl;
  39. cout << "Cups of Butter - " << butter_for_one * number_of_pies << endl;
  40. cout << "Large Eggs - " << eggs_for_one * number_of_pies << endl;
  41.  
  42. //it is working and i really hope this outputs properly or im gonna rage
  43. //fyi i hate irma for making my computer crash multiple times and not allowing me to work
  44. //so this actually works in the prompt but has 507 errors :,) why
  45. //it works now thank god 9-19-17
  46. return 0;
  47.  
  48. }
Add Comment
Please, Sign In to add comment