Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please answer alll . . 1. [10 marks) Write a program to check whether a year is leap year (filename: checkleapyear.html) 1) Write a function

image text in transcribed please answer alll
image text in transcribed
image text in transcribed
. . 1. [10 marks) Write a program to check whether a year is leap year (filename: checkleapyear.html) 1) Write a function called isLcap.Year Parameter: year Action: Check if the given year is a leap year. A year is a leap year if it is divisible by 4 but not by 100, or it is divisible by 400. // 2100: No. 2000: Yes Return: a Boolean value true false 2) Write another function called isLeap YearClicked with no parameter and no return value. The function prompts the user to enter a year, then calls the function isLeapYear with the year as the input parameter, and returns true or false. The function then displays the result in a message box. 3) Create a simple page with a heading and a button. When the button is clicked. it calls the isLsap YearClicked function 2. Write a program to create a user id (filename: createuserid.html) 1) Write a function called createUserld Parameters: first name and last name Action: Create a user id using the first letter of the first name and the first 5 letters of the last name (You may assume that the last name has at least 5 letters long). Then add a random number between 0 and 99 inclusive to the end. Make the userid all lowercase steateUserid("John", "Smith") might return jsmith26 Return: the user id . . Math.floor(Math.random(100) will give you the random number between 0 and 99 Use the to LowerCase function to convert a string to lower case 2) Write another function called createUserldClicked that will ask the user for the first name and last name, then call the function createUserId to get a new user id, and then use an alert box to display the new user id. 3) Create a simple page with a heading and a button. When the button is clicked, it calls the createUserIdClicked function. 3. [15 marks] Create a program for a customer to make bank transactions (filename: banktransactions.html) 1) Create a web page similar to the one shown below Make Bank Transacti X Make Bank Transactions Deposit Withdraw Transactions deposit: $200 withdraw: $150 Balance: 550 2) Create a global variable representing a bank account balance initialized to zero 3) Write a function named deposit to prompt the customer to enter the amount to deposit. The deposit transaction is then appended to the unordered list as shown above. Next, the amount of deposit is added to the balance and the balance on the web page is automatically updated, The statement to insert a new list item to a list is like the following: sesument.getElementById("trans").innerHTML += "
  • deposit: " + deposit + "
  • "; 4) Write a function named withdraw to prompt the customer to enter the amount to withdraw. The withdraw transaction is then appended to the unordered list as shown above. Next, the amount of withdraw is subtracted from the balance and the balance on the web page is automatically updated 5) When the Deposit button is clicked, it calls the deposit function. When the Withdraw button is clicked, it calls the withdraw function

    Step by Step Solution

    There are 3 Steps involved in it

    Step: 1

    blur-text-image

    Get Instant Access to Expert-Tailored Solutions

    See step-by-step solutions with expert insights and AI powered tools for academic success

    Step: 2

    blur-text-image_2

    Step: 3

    blur-text-image_3

    Ace Your Homework with AI

    Get the answers you need in no time with our AI-driven, step-by-step assistance

    Get Started

    Recommended Textbook for

    Professional Microsoft SQL Server 2014 Integration Services

    Authors: Brian Knight, Devin Knight

    1st Edition

    1118850904, 9781118850909

    More Books

    Students also viewed these Databases questions