AP Computer Science

Museum Ticket Generator

View Project (Try using discount codes "KIDSRULE" and "FREEFRIDAY")


var age;

var day;

var discountCode;

var price;

var weekday;



onEvent("calculateButton", "click", function() {

discountCode = getText ('discountInput');

day = getText ('dayDropdown');

age = getNumber ('ageDropdown');

if ((day == ('Monday')||day == ('Tuesday')||day == ('Wednesday')||day == ('Thursday')||day == ('Friday'))){

weekday = 'true';

}

if (day == ('Saturday') || day == ('Sunday')){

price = ('$10');

}else if ((weekday == 'true') && (age <= 10) && (discountCode.toLowerCase() == ('kidsrule'))){

price = ('$0');

}else if (discountCode.toLowerCase() == ("freefriday") && day == ('Friday')){

price = ('$0');

}else if ((weekday == 'true') && (age < 19)){

price = ('$5');

}else{

price = ('$10');

}

setText('ticketOutput','Thank you for purchasing a ticket! The price today will be ' + (price) + ' Please enjoy your day!');

}

);

Final Project - Mock Up Reminder App

*Note- App is optimized for the desktop client or landscape oriented tablet*Click on existing reminder to edit it. Click the checkbox to mark as completed. Click the checkmark to add a reminder. Click the dropdown to change the page.

Project Resources

Copy of Create Code
Copy of Create Written Response