Question: I keep getting the same result no matter how many times I change my answer. I submitted my code through an autograder and it tells me I’m getting the first 2 of 5 cases right. If I change it slightly, I then either get the last case right or everything wrong. I can’t seem to figure out what the problem is.
PROMPT: Write your code in the file Party.java. Use the IO module to read inputs and output answers.Suppose
that you are responsible for buying pizza and soda for your employer’s annual company party. You must
buy entire pizza pies and cases of soda (boxes of soda cans). You cannot buy individual slices of pizza or
cans of soda, nor can you buy fractional numbers of pizza pies or soda cases.
Ask the user for the following information, in this order:
the number of people attending the party
the number of slices of pizza each person should be able to eat
the number of cans of soda each person should be able to drink
the cost of a pizza pie
the number of slices in a pizza pie
the cost of a case of soda
the number of cans in a case of soda
Compute the total cost of the pizza and soda you will need to buy. Do not buy more than you need to in
order to supply each partygoer with the desired number of pizza slices and soda cans.
For this problem only, you may assume that the user will only enter positive numbers (you do not need
to check for this).
Example:
java Party
100
3
2
7.99
8
24.99
72
RESULT: 378.59
Explanation of example: We need 300 slices of pizza and 200 cans of soda. Since there are 8 slices in a
pie and 72 cans in a case, we need to buy at least 38 pies and 3 cases.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more