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

Learning Plan 4 4.3 Lab 2

# 4.3 Lab 2

#### File: /Learning Plan 4/4.3lab2.html

### Student

- Name:
- Section:
- Email:

### Lab Steps

1. Open this file in Firefox and Microsoft Visual Studio
2. Add your name, section, and email

## Part 1 problem statement

> Write a program that creates a greeting based on an entered code and a name. Prompt the user for their name and for a code of A, B, C, or D. Output one of the following greetings.

Code | Greeting
A | Hello, <user name>, how are you?
B | Top of the morning to you, <user name>!
C | Hi, <user name>.
D | <user name> is here! Welcome!

- Note: Use linear a nested if statement (`if/else if/else`) for this part.

### Part 1 Program Planning Lists

- In the following pre tag, write the three planning lists based on the verbs and nouns you see in the problem statement.

    The List of Input Variables:

    The List of Output Variables:

    The Process Checklist:

### Part 1 Test Plan

    TEST PLAN:

    Test Case 1:
        Inputs:

        Expected Results:

    Test Case 2:
        Inputs:

        Expected Results:

    Test Case 3:
        Inputs:

        Expected Results:

### Part 1 Example Output

    Hello, Fred, how are you?

### Part 1 Output:

## Part 2 problem statement

> Write a program that asks a user to enter their favorite ice cream from the choices of vanilla or chocolate. If they choose vanilla, then ask them if they would like M&Ms or Reese's Pieces on top. If they choose chocolate, then ask them if they want brownies or Oreos on top. Regardless of what they've chosen so far, ask the user if they would like whipped cream and, if they do, then ask if they want a cherry on top. Finally, output what they've chosen.

- Note: Use nested `if/else` statements for this part.

### Part 2 Program Planning Lists

- In the following pre tag, write the three planning lists based on the verbs and nouns you see in the problem statement.

    The List of Input Variables:

    The List of Output Variables:

    The Process Checklist:

### Part 2 Test Plan

    TEST PLAN:

    Test Case 1:
        Inputs:

        Expected Results:

    Test Case 2:
        Inputs:

        Expected Results:

    Test Case 3:
        Inputs:

        Expected Results:

### Part 2 Example Output

    You are having vanilla ice cream with Reese's Pieces, whipped cream and a cherry on top. Enjoy!

### Part 2 Output:

### 4.3 Assignment 2

- Here is the exercise that goes with this lab. .
  - 4.3 Assignment 2