Identifying rotten strawberries



Are you looking for something?


i didnot find a way to solve the above programme. Can you help me


I can really only help if you describe a problem, describe what you’ve tried, what you’re trying to do, what’s stopping you, what information you are missing - it’s up to you to drive the conversation



//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;

//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–)
_ //Insert inner for loop here_
for (var extraBerries = 0; extraBerries < 10; extraBerries++) {
earnings += 2.25;

//Boolean that returns true if your losses have been covered
var lossesCovered = true;

//Write an if statement that changes the lossesCovered to true
//if the earnings are greater than or equal to 225
var lossesCovered = true;
if (earnings >= 225) {
lossesCovered = true;
var lossesCovered = earnings >= 225;
console.log('Are losses covered? ', earnings >= 225 ? ‘Yeah’ : ‘No’);


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.