Question
The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year: 6/10/60
The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year: 6/10/60 Design a program that asks the user to enter a month (in numeric form), a day, and a two-digit year. The program should then determine whether the month times the day equals the year. If so, it should display a message saying the date is magic. Otherwise, it should display a message saying the date is not magic.
2. Running on a particular treadmill you burn 3.9 calories per minute. Write a program that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes.
8. E // // The date June 10, 1960, is special because when it is written in the following // format, the month times the day equals the year: // 10 11 12 13 // 6/10/60 14 // // Design a program that asks the user to enter a month (in numeric form), a day, // and a two-digit year. The program should then call a function to determine // whether the month times the day equals the year. If so, it should display a // message saying the date is magic. Otherwise, it should display a message // saying the date is not magic. // 15 16 17 18 19 20 21 22 Efunction magicDate (month, day, year) { 23 24 ///// // Insert your code between here and the next comment block. // any code in any other part of this file. /// 25 Do not alter // 26 // 27 28 29 /////// Do not alter // 30 ///// // Insert your code between here and the previous comment block. // any code in any other part of this file. ////// 31 32 // 33 ////////. 34 35 36 var month = parseInt (prompt ("Enter the two-digit month: ")); var day = parseInt (prompt ("Enter the two-digit day: ")); var year = parseInt (prompt ("Enter the two-digit year: ")); 37 38 39 40 if (magicDate (month, day, year)) { alert ('that is a magic date. '); } else { alert ('that is not a magic date. ); 41 42 43 44 45 46 L 47 48 49
Step by Step Solution
3.42 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
1 Python code accepting day dayintinputEnter the day accepting m...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started