Question
// Last month. Joe purchased some stock in Acme Software, Inc. Here are the // details of the purchase: // ' // The number of
// 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 year. The program should then call a function to determine // whether the month times the day equals the year. If the month times the day // equals the year then the function returns the boolean value true. If the month // times the day does not equal the year then the function returns the boolean value // false. // function magicDate(month. day, year) { ////////////////////////////////////////////////////////////////////////////////l // Insert your code between here and the next comment block. Do not alter // // any code in any other part of this file. // ////////////////////////////l//////////////////////////////////////////////////// let valueToReturn: if 19;) { I valueTbReturn = true; } else { me/VJ i valueTbReturn = false; 1 i return valueToReturn; 7//////////////////////////////////////////////////////////////////////////////// // Insert your code between here and the previous comment block. Do not alter // // any code in any other part of this file. // /////////////////////////l/////////////////////////////////////////////////////// } let mth = Parse!nt(prompt(\"Enter the month: "))3 let day = parse!nt(pronpt(\"Enter the day; u'); let year = parse!nt(prompt(\"Enter the year: ")); if (magicoate(month, day, year)! i ' alert('that is a magic date.'); } else { alertl'that is not a magic date.'); - ocean s eve is currently rising at about 1 6 mill' . . . . 1meters per // year. Write a function that is passed a number of years and then uses a loop ;; that calls the alert() function to display the total rise in ocean level for each // For example, if looking at the ocean level rise over 5 years the program would // display the following five alert with the values (don't worry about rounding and // formatting the output to look nice): // // Year 1.6 millimeters // Year 3.2 millimeters // Year 4.8 millimeters // Year - 6.4 millimeters // Year 8.0 millimeters // // When the loop ends the function will return the number of millimeters the ocean // has risen during this period. In this exampe, // function oceanRise(number0erars) { l//////////////////////////////////////////////////////////////////////////////// // Insert your code between here and the next comment block. Do not alter // // any code in any other part of this file. // /////////////////////////////I/////////////////////////////////////////////////// let totalRise = o; for (Q; { ' totalRise = totalRise + 1.6: alert('Year ' + year + ' ' + totalRise + ' millimeters'): 5 return totalRise; ///////////////////////////////////////////////////////////////////////////////// evious comment block. Do not alter // // Insert your code between here and the pr // // any code in any other part of this file. ///////////////////////////////////////////////////////I///////////////////////// } let numberOerars = prompt('0ver how many years would you like to display the rising in ocean levels? '); ' + oceanRise(number0erars) + ' millimeters'); . . n alert('In the next ' + numberOerars + ' years, the ocean will have rise Ln1,Col1 13b ,Iprr-hvv
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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