Northcentral Technical College Introduction To Programming
10-152-310
Introduction to Programming with JavaScript NTC 10-152-310

Learning Plan 6 6.1 Lab 4

# 6.1 Lab 4

#### File: /Learning Plan 6/6.1lab4.html

### Student

- Name:
- Section:
- Email:

### Lab Steps

1. Open this file in Firefox and Microsoft Visual Studio.
2. Add your name, section, and email.
3. Open the file /Learning Plan 6/jsFiles/6.1lab4.js in Microsoft Visual Studio.

### Problem Statement

> Design a program that will prompt a user for their first name, middle initial, and last name. Display the user on the page with this format: "Hello, John T. Public. How are you?"

1. Lab Details
   1. Write the Program Planning documents in comments in the JavaScript file.
   2. Use the prompt function for user input.
   3. Use a function to format the full name. The function should have 3 parameters: one for the first name, one for the middle initial, and one for the last name. The function should return a string that is the full name with this format, including period for the middle initial:
      - "Bob T. Smith"
   4. The main function should get the name from the user, call the full name function, and then output the greeting to the page.
   5. You will need to add some HTML elements to this page, either directly or with JavaScript.

### Example Output

    Hello, John T. Public. How are you?

### Your Output:

## 6.1 Assignment 2

- 6.1 Assignment 2