Page 1 of 1

How would I write this program?

Posted: Fri Jul 08, 2022 7:25 am
by answerhappygod
How would I write this program?
How Would I Write This Program 1
How Would I Write This Program 1 (70.63 KiB) Viewed 49 times
public class TeaTimes { } /** * We are having a party with amounts of tea and candy. * Return the int outcome of the party encoded as * 0-bad, 1-good, or 2-great. A party is good (1) if * both tea and candy are at least 5. However, if * either tea or candy is at least double the amount * of the other one, the party is great (2). However, * in all cases, if either tea or candy is less than 5, * the party is always bad (0). * * @param tea amount of tea * @param candy amount of candy @return outcome of the party */ // TODO: Write method teaParty here... /** * The chemistry club is having an afternoon tea time with * tea and candy. They wish to do a fun chemistry experiment * with their tea and candy before consuming it. Each time *they run their experiment, the amount of candy increases *by a given percentage. * Given the weight of tea and weight of candy they started * with, return the number of times they need to run the * experiment for the weight of candy to exceed the weight * of tea. Return -1 if the experiment will never increase * the candy. * * @param tea starting weight of tea @param candy starting weight of candy * @param percent percentage of candy growth each experiment run @return number of times experiment runs to have more candy than tea */ // TODO: Write method teaTimes here...