Graded A+
5.1.4: Do You Have a Dog? - ✅✅function start(){
var loggedIn = true;
println("Do you have a dog?: " + loggedIn);
}
5.2.6: Can You Graduate? - ✅✅function start(){
var doyouhaveenoughcredits = readBoolean("Do you have enough credits? ");
var rightrequirments = readBoolean("Do you have the right requirements? ");
var canBeGraduated = doyouhaveenoughcredits && rightrequirments;
println("Can be graduated: " + canBeGraduated);
}
5.2.7: School's Out - ✅✅function start(){
var holiday = readBoolean("Is today a holiday? ");
holiday = !holiday;
var weekday = readBoolean("Is today a weekday? ");
var school = holiday || weekday;
println("Holiday: " + school);
}
5.3.5: Rolling Dice - ✅✅function start(){
, var diceOne = readInt("First Dice Roll? ");
var diceTwo = readInt("Second Dice Roll? ");
var rolledDoubles = diceOne == diceTwo;
println("Got Doubles: " + rolledDoubles);
}
5.3.6: Girl Scout Designation - ✅✅function start(){
var boxesSold = readInt("How many boxes did you sell? ");
var badgesHave = readInt("How many badges do you have? ");
var hoursVolunteered = readInt("How many hours have you volunteered? ");
var goldStatus = boxesSold >= 50 && badgesHave >= 20 && hoursVolunteered
>=25 || boxesSold >= 100;
println("Do I have gold status: " + goldStatus);
}
5.4.7: Teenagers - ✅✅function start(){
var age = readInt("Age: ");
var teenager = (age>=13) && (age<=19);
if(teenager==true){
println("Yes, you are a teenager.");
}else{
print("No, you are not a teenager.");
}
}