Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In your editor of choice, create a new file and save it as a3.js. Make sure that this file is in the same directory as

In your editor of choice, create a new file and save it as a3.js. Make sure that this file is in the same directory as a3.html image text in transcribed
image text in transcribed
4. In a3.js, write the JavaScript to complete the following exercises. a) Write a function called determineCups() that prompts the user to enter the number of milliliters a recipe requires and then displays the corresponding number of cups to on the webpage inside the paragraph whose id is q1. One cup is 250mL. b) Write a function called calculateTip() that prompts the user to enter the cost of the meal as well as how much they would like to tip (as a percentage). The function should then display the following string to the console, supposing the user entered $100 and a 15% tip: "Your meal cost: $100 and a tip of 15% is $15 for a total of $115 " c) Write a function called formString() that prompts the user to enter their first and last name for you to store in variables. The function should then alert to the user a string that contains the following: - The first 3 letters of the first name all lowercase - The last 3 letters of the last name all capitalized - The sum of the lengths of the first and last name - Ex. Suppose the user enters "Jamie" and "McKee" then the alert would be "jamKEE10

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

Step: 3

blur-text-image

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

1. Review a general model of scientific research in psychology.

Answered: 1 week ago