Homework: Lesson 2 Inspiration v. Perspiration

I try to pass this homework in many ways, I still couldn’t pass this.
Anyone please guide me the solution.

inspiration = 0.01;
perspiration = 0.99;
double genius = (100 * inspiration) + (100 * perspiration);

Hey moon.view,

In this problem, we are given variables inspiration and perspiration that already have been assigned their double values. As a result, we cannot create new variables with the exact same name. Java would get confused when we try to refer to one of the two variables.

As a rule of thumb, never try to modify input variables (unless of course, that is your goal). You can create a new double variable insp with the same value as inspiration and change that, but changing inspiration itself is unnecessary. In your current submission, you change the value of inspiration and perspiration to a fixed number, meaning that genius will always equal 100 regardless of the value of the inputs which I think is the problem in your submission.

Try again without modifying the values of inspiration and perspiration. If there are still problems, you can ask further.

1 Like

Hey,

Here is a clue, go back to the instructions and look at the first few sentences and formula.

You only need to touch the ints with the value of 50 on the line.

1 Like

Now I get it, thanks

Binbug

I am having difficulty with understanding what you meant by “touch the ints with the value of 50 on the line”

Could you explain?

Thanks

Hello,

Is there any other clue that could assist me with this problem?

I am still having problems.

Could you critique my attempt please?

Double genius = inspiration + perspiration;
inspiration = 0.1 * (genius);
perspiration = .99 * (genius);
X = 0-100;
println(X);

Thank you in advance.