Hi everyone. Im from Puerto Rico, and Im studying Computing Science. Im actually taking my first course of programming, and it is called "Introduction to computer programming", and we are programming with C++. At this point almost everything has been theory, but now we are starting with practice, and I really have a lot of problems with the algorithm design.
For example here is one of the Problems I have to solve:
A government research lab has conluded that an artificial sweetener commonly
used in diet soda pop will cause death in laboratory mice. A friend of yours is desperate
to lose weight but cannot give up soda pop. Your friend wants to know how much diet
soda pop it is possible to drink without dying as a result. Write a program to supply the
answer. The input to the program is the amount of sweetener needed to kill a mouse, the
weight of a mouse, and the weight of the dieter. To ensure safety of your friend, be sure
the program requests the weight at which the dieter will stop dieting, rather than the
dieter’s current weight. Assume that diet soda contains 1/10th of 1% artificial sweetener.
Use a variable declaration with the modifier const to give a name to this fraction. You
may want to express the percentage as a double value 0.001. Your program should allow
the calculation to be repeated as often as the user wishes.
I have already done some things, like this:
#include <iostream>
using nameplate std;
int main()
{
double amount_of_sweetener_mouse, weight_of_mouse, weight_of_dieter, amount_of_sweetener,
int amount_of_soda
const int sweetener_in_soda = 0.001
cout << "Enter the sweetener needed to kill a mouse.\n";
cin >> amount_of_sweetener_mouse;
cout << "Now enter the weight of the mouse.\n";
cin >> weight_of_mouse;
cout << "Enter the weight at which the dieter will stop dieting.\n";
cin >> weight_of_dieter;
amount_of_sweetener = (amount_of_sweetener_mouse / weight_of_mouse) * weight_of_dieter
Now, I do not know how I can put how to find how much soda does the dieter needs in order to die...
I do not actually want you guys to do the homework for me, I just want some help because I really want to learn how to program and Im starting and I have a lot of doubts.
Thanks :D