Skip to content

you input the ingredients of the burger, how much ingredients you already have, how much each ingredient is, and how much money you have, and it tells you the maximum amount of sandwiches you can make!

Notifications You must be signed in to change notification settings

laila-1/sandwich-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

sandwich-maker: you input the ingredients of the burger and their price, how much ingredients you already have, and how much money you have, and it tells you the maximum amount of sandwiches you can make!

The recipe will be listed as a string consisting of the first letter of the ingredients capitalized: The ingredients in the recipe go from bottom to top, for example, recipe "ВSCBS" represents the hamburger where the ingredients go from bottom to top as bread, sausage, cheese, bread and sausage again.

example: bread = B sausage = S cheese = C and so on...

image

here in this example the maximum amount of sandwiches you can make is two since: we need three pieces of bread to make one sandwich, and we have six. we need two sausages to make a sandwich, and we have four. we need a slice of cheese to make a sandwich, and we have one. the price of a slice of cheese is 3$, so by spending our money, we can buy one more slice, and we'll have a dollar remaining. that's just enough to make two sandwiches, and not more.

PS: if you don't know how to run a c++ code, you can copy the code and paste it in codeblocks or visual basic! in codeblocks, clicking on f9 will do.

About

you input the ingredients of the burger, how much ingredients you already have, how much each ingredient is, and how much money you have, and it tells you the maximum amount of sandwiches you can make!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages