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

Learning Plan 4 4.3 Assignment 2

# 4.3 Assignment 2

#### File: /Learning Plan 4/exercises-5.html

### Student

- Name:
- Section:
- Email:

## Part 1

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

### Part 1 Problem Statement

> Write a JavaScript program that asks the user how many kids were in their family when growing up and how many bedrooms there were in the house. For the sake of simplicity let's only code for 1, 2, or 3 or more kids, and 1, 2, 3 or more bedrooms. Look at the following chart and output a message for every combination of kids and bedrooms.

| Bedrooms
K i d s |  | 1 | 2 | >= 3
1 | Lucky | Spacious | Empty Feeling
2 | Cozy | Lucky | Spacious
>= 3 | Crowded | Cozy | Lucky

### 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:

    Test Case 4:
        Inputs:

        Expected Results:

    Test Case 5:
        Inputs:

        Expected Results:

- Sample Part 1 Output:

    With 1 kid and 3 bedrooms you must have an empty feeling!

- OR

    With 3 kids and 1 bedroom you must be crowded!

- OR

    With 2 kids and 2 bedrooms you must feel lucky!

### Your Part 1 Output:

## Part 2

### Part 2 Problem Statement

> Write a program that asks a user for the weight of a package. Determine the shipping cost of the package with the following chart.

Package Weight | Shipping Cost
2 lbs. or less | $2.25
> 2 lbs. to <= 5 lbs. | $3.50
> 5 lbs. to <= 10 lbs. | $5.00
> 10 lbs. to <= 20 lbs. | $7.50
> 20 lbs. | $10.00

> Output the weight of the package and the shipping cost to the page.

### 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:

    Test Case 4:
        Inputs:

        Expected Results:

    Test Case 5:
        Inputs:

        Expected Results:

- Sample Part 2 Output:

    Your package that weighs 3.5 lbs. will cost $3.50 to ship.

### Your Part 2 Output:

### Submitting work

- Zip and submit this page 4.3 Assignment 2