Question

Task #1 Create a program that: 1. Has a comment in the JavaScript code with your name and student number 2. Asks the user for
0 0
Add a comment Improve this question Transcribed image text
Answer #1

/* save file with name index.html and open with browser*/

<!DOCTYPE html>
<html lang="en">
<head>
<script>
// javascript code
var fname = prompt("Enter your first name: ");
var lname = prompt("Enter your last name: ");
var name = fname+" "+lname;
alert("Your full name is: "+name);t
  
</script>
</head>
<body >
  
</body>
</html>

<!DOCTYPE html> <html lang=en> <head> <script> javascript code var fname = prompt(Enter your first name: ); var lname = p

/* OUPUT */

This page says Enter your first name: Joel OK Cancel

This page says Enter your last name: Smith OK Cancel

This page says Your full name is: Joe Smith OK

/* PLEASE UPVOTE */

Add a comment
Know the answer?
Add Answer to:
Task #1 Create a program that: 1. Has a comment in the JavaScript code with your...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • a) In Atom, create a new program file named greetByfullName.jsin your pl folder. b) Write a...

    a) In Atom, create a new program file named greetByfullName.jsin your pl folder. b) Write a function named greetByfullName that accepts two strings (firstName and lastName), and returns a cheery greeting. c) Test the function by prompting the user to enter their first name, and storing the name in a variable, and then prompting the user for their last name, and storing it in a second variable. This page says Enter your first name Susan Cancel OK This page says...

  • Question 1 (Marks: 35) Create a class named Customer that will determine the monthly repayment amount...

    Question 1 (Marks: 35) Create a class named Customer that will determine the monthly repayment amount due by a customer for a product bought on credit. The class has five fields: customer name, contact number, product price, number of months and the monthly repayment amount. Write get and set methods for each field, except for the monthly repayment amount field. The set methods must prompt the user to enter the values for the following fields: customer name, contact number, product...

  • Design a modular program using pseudo-code which prompts a user for their first name, followed by...

    Design a modular program using pseudo-code which prompts a user for their first name, followed by their last name; then displays a "Hello" salutation which concatenates their first name with their last name. Sample output (user input shown in red): Please enter your first name: John Please enter your last name: Smith Hello, John Smith! Your program must include a main module and one function; this function prompts the user for either their first name or last name, using a...

  • Could I get some help with the following Task? The program should be implemented in JavaScript and running on Firefox, a web browser independent to operating systems. The client has specified the foll...

    Could I get some help with the following Task? The program should be implemented in JavaScript and running on Firefox, a web browser independent to operating systems. The client has specified the following requirements for the functionality of the program: 1. The program should be running without errors throughout two Phases: Information Gathering and Information Presenting. 2. Information Gathering is to gather the information such as state/territory name, the population and population change over previous year for calculation of APG;...

  • Python code. No use of def() or return. 7a)Create a program that asks the user for...

    Python code. No use of def() or return. 7a)Create a program that asks the user for their full name (first, middle, and last). You can assume that compound names, such as Jamie-Lynn are joined by a hyphen, that names are separated by a space and that the user enters their data in the correct format. The program should then separate the first name, middle name, and last name from the single string entered by the user and save each piece...

  • Please write this program in C++, thanks Task 9.3 Write a complete C++ program to create a music player Your program sh...

    Please write this program in C++, thanks Task 9.3 Write a complete C++ program to create a music player Your program should read in several album names, each album has up to 5 tracks as well as a genre. First declare genre for the album as an enumeration with at least three entries. Then declare an album structure that has five elements to hold the album name, genre, number of tracks, name of those tracks and track location. You can...

  • 1. Create a script ScptCalXX (replace XX with your first or last name that does the...

    1. Create a script ScptCalXX (replace XX with your first or last name that does the following • It asks for your name with the following prompt: Please enter your name: • Then it asks for your city with the following prompt: Please enter the city where you live in: • Then it greets you with your name and city: Hello Syed from Toronto, how much money you want to invest today (-1 to quit)? (in case someone entered Syed...

  • read the code and comments, and fix the program by INSERTING the missing code in Java...

    read the code and comments, and fix the program by INSERTING the missing code in Java THank you please import java.util.Scanner; public class ExtractNames { // Extract (and print to standard output) the first and last names in "Last, First" (read from standard input). public static void main(String[] args) { // Set up a Scanner object for reading input from the user (keyboard). Scanner scan = new Scanner (System.in); // Read a full name from the user as "Last, First"....

  • i need help with this homework webpage and code too: The webpage must include: Global Structure...

    i need help with this homework webpage and code too: The webpage must include: Global Structure Tags Text Tags Images   Your first page must be named index.html Include a table within your site, challenge yourself to add a header in the table, and choose interesting border and/or cell formatting. Include a hyperlink within your site. Include an image in your site. Include a form in your site to demonstrate understanding of a variety of form components (the form does not...

  • 1. Write a C++ program that will ask the user for their full name and calculate...

    1. Write a C++ program that will ask the user for their full name and calculate the user's weekly salary based on their hourly wage and the number of hours they worked, assuming no overtime at this point. Sample program run: Please enter first name: Elmer Please enter middle initial (Enter space if none): J Please enter last name: Fudd Enter hours worked: 37.5 Enter hourly rate: 10.35 Your name is: Elmer J. Fudd Your weekly salary is: $388.12 2....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT