- script.js
JavaScript
var red = 1;
var yellow = 2;
var green = 3;
var blue = 2;
if (blue > yellow) {
console.log('There are just as many blue markers as there are yellow ones or even more. The risks are great.');
} else {
console.log('Wrong! The forecast is unacceptable!');
}
if (blue < yellow) {
console.log('There are just as many blue markers as there are yellow ones or less. Risks are optimal.');
} else {
console.log('Wrong! The forecast is unacceptable!');
}
if (red < yellow) {
console.log('Red markers are in the minority. The forecast is moderately positive!');
} else {
console.log('Wrong! The forecast is unacceptable!');
}
if (green > yellow) {
console.log('Green markers prevail over the yellow ones. The forecast is positive!');
} else {
console.log('Wrong! The forecast is unacceptable!');
}
Result
Goalscompleted
Correct the code of the modified program to compare the number of markers.
- Replace the comparison operator with
>=
in the firstif
. - Replace the comparison operator with
<=
in the secondif
.
Comments