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

Learning Plan 4 4.2 Lab 3

# 4.2 Lab 3

#### File: /Learning Plan 4/4.2lab3.html

### Student

- Name:
- Section:
- Email:

### Lab Steps

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

### Lab problem statement

> Write a program that asks a user to enter a string. Then ask the user to enter a string that will sort after the first string in an ASCII sort. ("A" sorts before "B".) If the second string is after the first in an ASCII sort then output a message that includes both strings and a success message. If the second string does not sort after the first string then output the strings and ask the user to try again.

### Lab Steps

1. Open this file in Firefox and Microsoft Visual Studio
2. Add your name, section, and email
3. Add code after the line: `YOUR CODE STARTS AFTER THIS LINE:` to complete this lab.
4. Your output should look like the Example Output below.
5. Variable declarations section
   1. Write a comment that identifies this coding section.
   2. Declare a variable to hold the first string.
   3. Declare a variable to hold the second string.
6. Assignments section
   1. Write a comment that identifies this coding section.
   2. Prompt a user to enter a string and store it in the first variable.
   3. Prompt a user to enter a string that will sort after than the first one and store it in the second variable.
7. Logic and Ouput section
   1. Write a comment that identifies this coding section.
   2. If the second string sorts after the first then output:
      - "Very good, `<second string>` comes after `<first string>`.
   3. If the second string does not sort after the first then output:
      - "`<second string>`" is the same or does not sort after "`<first string>` ", please try again."

### Test Plan

    TEST PLAN:

    Test Case 1:
        Inputs:

        Expected Results:

    Test Case 2:
        Inputs:

        Expected Results:

    Test Case 3:
        Inputs:

        Expected Results:

    Test Case 4:
        Inputs:

        Expected Results:

### Example Output

    Very good, "fred" comes after "Fred".

- OR

    "Fred" is the same or does not sort after "fred", please try again.

### Your Output:

### 4.2 Assignment 3

- Here is the exercise that goes with this lab.
  - 4.2 Assignment 3