7. Method Name: dayActivity Parameters: one parameter, day Return value: none Purpose: This function accepts one...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
7. Method Name: dayActivity Parameters: one parameter, day Return value: none Purpose: This function accepts one parameter named day. It will use a switch statement to test if the day is one of several days. It then outputs a phrase based on the day. 7.1. Declare a variable, output using the let keyword. 7.2. Implement a switch structure and switch on the value of the day parameter. Set the value of the output variable based on the following values Day Output value Monday Not again! Wednesday Half way there! Friday Sunday TGIF! Sunday Funday! All Other Days Just another day! 7.3. Log the output to the Console. 8. Method Name: print Table Parameters: none Return value: none Purpose: This method a multiplication table to the console 8.1. Implement a nested loop structure to output the multiplication table of from 1 to 5. Multiply each number from 1 to 5 with numbers from 1 to 5. (See sample output for format). 8.1.1. Log the output to the console in the format "1*2-2" 8.2. Insert linebreaks as appropriate using \n characters! Work on the JavaScript file and define the following methods. 4. Method Name: average Parameters: none Return value: none Purpose: This method should calculate the average of all numbers from 1 to 10 4.1. Declare any variables you need with restricted scope within the method using the let keyword. 4.2. Implement code to calculate the average of all numbers from 10 10 (inclusive). Use a for loop. 4.3. Output the average to the console using the log function. 5. Method Name: isEven Parameters: one parameter, number Return value: boolean Purpose: This function accepts one parameter value and returns a boolean value indicating if the parameter was even or not. 5.1. Declare any variables you need with restricted scope within the method using the let keyword. 5.1.1. Use the remainder operator (%) and the equal value & type comparison operator (===) 5.2. Return true if number is even and return false if number is odd 6. Method Name: testNumber Parameters: one parameter, number Return value: none Purpose: This method receives a number as a parameter value. It should invoke the isEven function to test if number is even or not. It should then log the result to the console. 6.1. Use the isEven function 6.1.1. Invoke the isEven method and pass it number as an argument. 6.1.2. Store the return value in another variable, evenNumber, declared with restricted scope within the method using the let keyword 6.2. Test the evenNumber variable 6.2.1. Based on the value of evenNumber, log to the console whether the number is even or odd. Sample Output - HTML Rendering Average of 1 to 10 Test Number 6 Test Number 245 Day Activity Tuesday Day Activity Sunday Print Table Sample Output - Console О Group sunte messages Sunday: Sunday Funday " Tuesday: Just another day! Contd... Sunday: Sunday Funday! 1-1-1 1-2-2 2-1-2 2 2 12 4-3-12 16 2-3-6 2 4 5-2-10 5-3-15 3+2+6 5-4-20 3-3-9 3-4-12 2.1. Create a new HTML file. Save the file as javascriptbasics.html. 2.2. Add html, head, meta charset, title, and body tags. 2.3. Set the title of the page to "JavaScript Basics" 2.4. Add a script element within the head element of the HTML page. 2.5. Set the source of the script to script.js 2.6. Add a new external JavaScript file and save it as script.js 2.7. Add your name, assignment #, class, and class time as a comment at the top of the both HTML and the JavaScript files. e.g, John Smith, AS, CIS 235, 9 am Work on the HTML file 3. Add button elements to the HTML body 3.1. Create the buttons as seen below in the table. Set the button text as described. 3.2. Add onclick attributes for each of the buttons 3.2.1. Invoke the corresponding JavaScript function as an event handler. 3.2.2. If an argument is listed, pass the argument within the inline function call. Button name Average Of 1 To 10 Test Number 6 onClick event-handler function Argument average testNumber testNumber Test Number 245 Day Activity: Tuesday day Activity Day Activity: Sunday Print Table day Activity printTable 245 Tuesday (string) Sunday (string) 7. Method Name: dayActivity Parameters: one parameter, day Return value: none Purpose: This function accepts one parameter named day. It will use a switch statement to test if the day is one of several days. It then outputs a phrase based on the day. 7.1. Declare a variable, output using the let keyword. 7.2. Implement a switch structure and switch on the value of the day parameter. Set the value of the output variable based on the following values Day Output value Monday Not again! Wednesday Half way there! Friday Sunday TGIF! Sunday Funday! All Other Days Just another day! 7.3. Log the output to the Console. 8. Method Name: print Table Parameters: none Return value: none Purpose: This method a multiplication table to the console 8.1. Implement a nested loop structure to output the multiplication table of from 1 to 5. Multiply each number from 1 to 5 with numbers from 1 to 5. (See sample output for format). 8.1.1. Log the output to the console in the format "1*2-2" 8.2. Insert linebreaks as appropriate using \n characters! Work on the JavaScript file and define the following methods. 4. Method Name: average Parameters: none Return value: none Purpose: This method should calculate the average of all numbers from 1 to 10 4.1. Declare any variables you need with restricted scope within the method using the let keyword. 4.2. Implement code to calculate the average of all numbers from 10 10 (inclusive). Use a for loop. 4.3. Output the average to the console using the log function. 5. Method Name: isEven Parameters: one parameter, number Return value: boolean Purpose: This function accepts one parameter value and returns a boolean value indicating if the parameter was even or not. 5.1. Declare any variables you need with restricted scope within the method using the let keyword. 5.1.1. Use the remainder operator (%) and the equal value & type comparison operator (===) 5.2. Return true if number is even and return false if number is odd 6. Method Name: testNumber Parameters: one parameter, number Return value: none Purpose: This method receives a number as a parameter value. It should invoke the isEven function to test if number is even or not. It should then log the result to the console. 6.1. Use the isEven function 6.1.1. Invoke the isEven method and pass it number as an argument. 6.1.2. Store the return value in another variable, evenNumber, declared with restricted scope within the method using the let keyword 6.2. Test the evenNumber variable 6.2.1. Based on the value of evenNumber, log to the console whether the number is even or odd. Sample Output - HTML Rendering Average of 1 to 10 Test Number 6 Test Number 245 Day Activity Tuesday Day Activity Sunday Print Table Sample Output - Console О Group sunte messages Sunday: Sunday Funday " Tuesday: Just another day! Contd... Sunday: Sunday Funday! 1-1-1 1-2-2 2-1-2 2 2 12 4-3-12 16 2-3-6 2 4 5-2-10 5-3-15 3+2+6 5-4-20 3-3-9 3-4-12 2.1. Create a new HTML file. Save the file as javascriptbasics.html. 2.2. Add html, head, meta charset, title, and body tags. 2.3. Set the title of the page to "JavaScript Basics" 2.4. Add a script element within the head element of the HTML page. 2.5. Set the source of the script to script.js 2.6. Add a new external JavaScript file and save it as script.js 2.7. Add your name, assignment #, class, and class time as a comment at the top of the both HTML and the JavaScript files. e.g, John Smith, AS, CIS 235, 9 am Work on the HTML file 3. Add button elements to the HTML body 3.1. Create the buttons as seen below in the table. Set the button text as described. 3.2. Add onclick attributes for each of the buttons 3.2.1. Invoke the corresponding JavaScript function as an event handler. 3.2.2. If an argument is listed, pass the argument within the inline function call. Button name Average Of 1 To 10 Test Number 6 onClick event-handler function Argument average testNumber testNumber Test Number 245 Day Activity: Tuesday day Activity Day Activity: Sunday Print Table day Activity printTable 245 Tuesday (string) Sunday (string)
Expert Answer:
Answer rating: 100% (QA)
public static String dayActivityString day switchday case Monday return Not ag... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
In this problem, you will use your knowledge of the phase plane and stability to analyze a simple model of glycolysis. The glycolysis pathway that first convert glucose into fructose-6-phosphate...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Suppose that Marthas income rises to $42,000 per year, and that she increases her consumption of health care visits by fi ve visits. Using the graphs for Exercise 1, draw the new equilibrium. What is...
-
As CEO of Aqua Marine, Carrie Easton knows it is important to control costs and to respond quickly to changes in the highly competitive boat-building industry. When Rose Consulting proposes that Aqua...
-
For the following exercises, find a function of the form y = ab x + csin (/2 x) that fits the given data. x 0 1 y 6 29 2 96 3 379
-
Assuming the same data as given in problem 9, was the well in each case profitable? Discuss your answer. Problem 9:- Property cost (acquisition cost). Drilling cost (one well). Estimated completion...
-
Loxley Corporation is authorized to issue 50,000 shares of $10 par value common stock. During 2012, Loxley took part in the following selected transactions. 1. Issued 5,000 shares of stock at $45 per...
-
The half-life of a certain brand of ice cream is 180 minutes. a. Find the decay rate of the ice cream. (6 decimal places) b. How long will it take for it to decay to 60% of the original amount. c. At...
-
Using exponential smoothing with trend, a smoothing constant of 4, if the forecast for January had been 110, compute what the exponential forecast would have been for the month of April using January...
-
Calculate the magnitude of the force acting on the pin at D. Pin C is fixed in DE and bears against the smooth slot in the triangular plate. 200 N 135 mm B Answer: D = 135 mm- 95 mm 110 mm N
-
1. What career are you currently working toward or considering? Respiratory Therapist 2. What is the current median salary of your stated career choice The average Registered Respiratory Therapist...
-
Question 7: [20 points] In North Carolina (NC), there are gas shortages. A shortage" is when the market price for an item is such that quantity demanded greatly exceeds quantity supplied. The federal...
-
Consider Hurd Co., a U.S.-based MNC with a subsidiary in Mexico that deals in Mexican pesos (MXP). The subsidiary requires MXP200,000,000 to finance its operations over the next three years. Assume...
-
Tic Tac Toe: You will be given a series of moves in a Tic Tac Toe (or Xs and Os) game. You have to figure out who the winner of the game is. Assume that the first move of the game is made by the...
-
Pls help me write code for the given problems. I'm new and trying to figure it out 2 questions and there are test cases for each. Question A) PayMoney processes thousands of transactions daily...
-
The dating web site Oollama.com requires its users to create profiles based on a survey in which they rate their interest (on a scale from 0 to 3) in five categories: physical fitness, music,...
-
Prove the formula for (d/dx)(cos-1x) by the same method as for (d/dx)(sin-1x).
-
a. For each of the reactions in parts (a), (b), and (c), suggest a mechanism and apply the PSSH to learn if the mechanism is consistent with the rate law. b. The gas-phase homogeneous oxidation of...
-
The equations describing diffusion and reaction in porous catalysts also can be used to derive rates of tissue growth and have been studied by Professor Kristi Anseth and her students at the...
-
Go to the LearnChemE screencast link for Chapter 15 (http://www.learncheme.com/screencasts/kinetics-reactor-design). View the two screencasts: (1) Diffusion and Reaction in a Cylindrical Porous...
-
Based on the photographs in Figure 26.13, in which segment(s) is the Antp gene normally expressed? Figure 26.13: (a) Normal fly (b) Antennapedia mutant
-
The bush baby, a small African mammal, is a remarkable jumper. Although only about 8 inches long, it can jump, from a standing start, straight up to a height of over 7 feet! Use the particle model to...
-
Hicham El Guerrouj of Morocco holds the world record in the 1500 m running race. He ran the final 400 m in a time of 51.9 s. What was his average speed in mph over the last 400 m? A. 14.2 mph B. 15.5...
Study smarter with the SolutionInn App