First of all SWEETNER_PERCENT_SODA = .1/100*AMOUNT_SODA ;
abelLazm
Postaholic
2,113 posts since Feb 2011
Reputation Points: 219
Solved Threads: 124
Skill Endorsements: 1
i can't understand Line # 23 how can you say that??? 12 oz of soda killed a mouse the that 12 oz contain 0.1 % sweetener inside it then why to calculate again?
abelLazm
Postaholic
2,113 posts since Feb 2011
Reputation Points: 219
Solved Threads: 124
Skill Endorsements: 1
if 12oz of soda killed 2 lbs of mouse than it means 6 oz soda is enough for 1 lb.... If it is true than if the weight of you friend is also in lbs then just multiply the weight with 6oz
//declare variables
int AMOUNT_SODA;
int MOUSE_WEIGHT;
int START_WEIGHT;
int DESIRED_WEIGHT;
double SWEETNER_PERCENT_SODA;
double sweetnerKillMouse_2lb; // amount of sweetner that will kill mouae
double sweetnerKillMouse_1lb;
double sweetnerKillHuman;//amount of soda that will kill a human
double newAmountSoda;
//assigne variables
AMOUNT_SODA = 12;//espressed in oz
MOUSE_WEIGHT = 2;//expressed in lbs
START_WEIGHT = 150;
DESIRED_WEIGHT = 140;
SWEETNER_PERCENT_SODA = (0.1/100) *AMOUNT_SODA
//find out how much sweet ner killed te mouse
// sweetnerKillMouse = SWEETNER_PERCENT_SODA * AMOUNT_SODA;
sweetnerKillMouse_2lb = SWEETNER_PERCENT_SODA;
sweetnerKillMouse_1lb=sweetnerKillMouse_2lb/2;
//find out how much sweetner human drinks till he dies
//(amount of sweetner that kills human / human weight) = (amount that kills mouse / mouse weight)
// sweetnerKillHuman = DESIRED_WEIGHT * sweetnerKillMouse / MOUSE_WEIGHT;
sweetnerKillHuman = DESIRED_WEIGHT * sweetnerKillMouse_1lb;
//find out the total amount of sida which has the amount of sweetner that kills a human
//(amount of sweetner that kills the mouse / amount of soda ) = (amount of sweetner that kills human / new amount of soda)
newAmountSoda = (AMOUNT_SODA * sweetnerKillHuman) / sweetnerKillMouse;
//display
System.out.println(newAmountSoda);//MY RESULT IS 840.00
abelLazm
Postaholic
2,113 posts since Feb 2011
Reputation Points: 219
Solved Threads: 124
Skill Endorsements: 1
Question Answered as of 1 Year Ago by
abelLazm