<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
my code causes the browser window to crash.
//To make up the money you lost from picking rotten strawberries,
//you decide to pick 10 extra strawberries everyday for the next
//7 days.
//Your earnings
var earnings = 0;
var berries = 0
//Fill in the outer loop with an inner loop that loops through
//10 strawberries and increment your earnings by 2.25 for every
//extra strawberry that you pick
for (var days = 7; days > 0; days--){
if(days !== 0){
berries = berries + 10;
for (var count ; count){
count = count * 2.25
}
//Insert inner for loop here
}
}
//Boolean that returns true if your losses have been covered
var lossesCovered = true;
if (earnings > 225) {
lossesCovered = true;
}
//Write an if statement that changes the lossesCovered to true
//if the earnings are greater than or equal to 225
I made an edit and tried the below code. It appears to solve the equation, but Iām still getting an error.
//To make up the money you lost from picking rotten strawberries,
//you decide to pick 10 extra strawberries everyday for the next
//7 days.
//Your earnings
var earnings = 0;
var strawberries = 0;
//Fill in the outer loop with an inner loop that loops through
//10 strawberries and increment your earnings by 2.25 for every
//extra strawberry that you pick
for (var days = 7; days > 0; days--){
if(days !== 0){
strawberries = strawberries + 10;
for (strawberries; strawberries > 0; strawberries--){
if (strawberries > 0){
earnings = earnings + 2.25;
}
}
//Insert inner for loop here
}
}
//Boolean that returns true if your losses have been covered
if (earnings > 225) {
var lossesCovered = true
}else{
var lossesCovered = false
}
console.log(strawberries)
console.log(earnings)
console.log(lossesCovered)
//Write an if statement that changes the lossesCovered to true
//if the earnings are greater than or equal to 225