Question

Challenge: Its the weekend! Make an app tells you whether to stay home or go to school based on what day of the week it is.

o Otherwise (the day is a weekday) display a message that says Its a weekday. Go to school. Your message should be display

HINT:[click to expand] The trick here is that, unless you want to check all seven days with individual if-statements, you nee

IF its sunday ELSE

0 0
Add a comment Improve this question Transcribed image text
Answer #1

First Drag Drop down in design menu and add days of weeks as Options.

Code screenl Challenge Its the weekend Design Toolbox Version History What should I do today? Drag the elements into your ap

Then you can do this by following code in CODE mode

onEvent("dropdown", "change", function() {
var day = getText("dropdown");
if (day == "Sunday") {
setText("msg_label","It's Weekend! Stay Home");
} else if (day == "Saturday") {
setText("msg_label","It's Weekend! Stay Home");
} else{
setText("msg_label","Its weekday! Go School");
}
});


Screenshots of working project

And You can Do this by also by instead of writing if statement for both saturday and sunday you can just user or operator in single if statment then the code will be as follows

onEvent("dropdown", "change", function() {
var day = getText("dropdown");
if ((day == "Saturday") || (day == "Sunday")) {
setText("msg_label","It's Weekend! Stay Home");
} else{
setText("msg_label","Its weekday! Go School");
}
});

This will solve this problem. Please Do consider upvoting if it has solved your problem.

Thanks

Add a comment
Know the answer?
Add Answer to:
Challenge: It's the weekend! Make an app tells you whether to stay home or go to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • It's your third week on the job at Panache Inc. Last week, you made sure all...

    It's your third week on the job at Panache Inc. Last week, you made sure all investment transactions for trading, available-for-sale, held-to-maturity, and equity securities were properly recorded. You are reviewing the financial statement reporting for the securities and have found a newspaper clipping dated December 31 that indicates the price of the stock of Omni Company had dropped the day before because of the company's severe financial difficulties. While the company is not expected to fail, the article states...

  • It's your third week on the job at Panache Inc. Last week, you made sure all...

    It's your third week on the job at Panache Inc. Last week, you made sure all investment transactions for trading, available-for-sale, held-to-maturity, and equity securities were properly recorded. You are reviewing the financial statement reporting for the securities and have found a newspaper clipping dated December 31 that indicates the price of the stock of Omni Company had dropped the day before because of the company's severe financial difficulties. While the company is not expected to fail, the article states...

  • In Real Life: Win-Win Problem Solving [ Silence ] [ Noises ] >> Can you be...

    In Real Life: Win-Win Problem Solving [ Silence ] [ Noises ] >> Can you be a little more quiet? I don't have class until 10 o'clock. I want to catch up on some sleep. >> Sorry to bother you. I am cleaning up last night's dinner dishes. >> Well, I wish you would do it a little more quietly. I was up late studying, >> Well if you would've washed them last night, I wouldn't have had to clean...

  • Question 1: Wendy's Happy Homes Inc manufactures Home Appliances. Monthly sales of Wendy's Washer...

    Question 1: Wendy's Happy Homes Inc manufactures Home Appliances. Monthly sales of Wendy's Washers and Dryer Sets for a nine month period were as follows: MONTH Washer and Dryer Sales 490 480 450 500 480 470 490 520 530 January February March April May June July August September Forecast October sales using 1) A four-month moving average 2) a six-month moving average 3. Compute the MAD for each forecast method you used Actual October sales were 320 nits. 4) Which...

  • C LANGUAGE. PLEASE INCLUDE COMMENTS :) >>>>TheCafe V2.c<<<< #include ...

    C LANGUAGE. PLEASE INCLUDE COMMENTS :) >>>>TheCafe V2.c<<<< #include <stdio.h> int main() { int fries; // A flag denoting whether they want fries or not. char bacon; // A character for storing their bacon preference. double cost = 0.0; // The total cost of their meal, initialized to start at 0.0 int choice; // A variable new to version 2, choice is an int that will store the // user's menu choice. It will also serve as our loop control...

  • Part I Frank Spring knew this was not going to be a good morning as he...

    Part I Frank Spring knew this was not going to be a good morning as he looked out into the packed ER waiting room. Scattered among the usual collection of cuts, broken bones, and respiratory problems were over a dozen people clustered around the restrooms. Despite their pale appearance and frantic dashes into the restrooms, they were all talking with each other not usual behavior for a group of strangers in the ER. Several others held young children. "Morning, Sam....

  • please use python and provide run result, thank you! click on pic to make it bigger...

    please use python and provide run result, thank you! click on pic to make it bigger For this assignment you will have to investigate the use of the Python random library's random generator function, random.randrange(stop), randrange produces a random integer in the range of 0 to stop-1. You will need to import random at the top of your program. You can find this in the text or using the online resources given in the lectures A Slot Machine Simulation Understand...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • 5. Please answer the following questions with respect to PLC Theory (8) a. Which phase of...

    5. Please answer the following questions with respect to PLC Theory (8) a. Which phase of the PLC is the pizza business? What indicators can you list? b. Given the phase of the PLC you indicated at part a: 1. What marketing mix strategies would you expect Dominos to be using? il. What marketing mix strategies is Dominos actually using? Ill. What disconnects, issues or questions arise from parts I and il above? The Strategy Carrying Domino's to New Heights...

  • In this assignment you will implement software for your local library. The user of the software...

    In this assignment you will implement software for your local library. The user of the software will be the librarian, who uses your program to issue library cards, check books out to patrons, check books back in, send out overdue notices, and open and close the library. class Calendar We need to deal with the passage of time, so we need to keep track of Java. Declare this variable as private int date within the class itself, not within any...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT