Submit pseudocode and a flowchart for the following programming exercise:

Largest and Smallest

Design a program with a loop that lets the user enter a series of numbers. Theuser should enter -99 to signal the end of the series. After all the numbers have been entered, the program should display the largest and smallest numbers entered.

I'll give you a skeleton. Fill in the meat and post what you have.

int max=-99, min=-99, num;
do
input num
if num==-99 then exit loop endif
if max=-99 then ..... endif
if num>max then ..... endif
if num<min then ..... endif
loop
Display max, min.

Here is the pseudocode for the program:

1. Initialize a variable smallest_num to a large value
2. Initialize a variable largest_num to a small value
3. Initialize a variable num to 0
4. Read the first number entered by the user and assign it to num
5. While num is not equal to -99, do steps 6-9
6. If num is smaller than smallest_num, assign num to smallest_num
7. If num is larger than largest_num, assign num to largest_num
8. Read the next number entered by the user and assign it to num
9. End the while loop
10. Display the largest_num and smallest_num

And here is the flowchart for the program:

START
├─┬─ Read num
│ └─ Is num = -99?
│ ├─ Yes ────────► END
│ └─ No ──────────► Check num
│ ├─ Is num < smallest_num?
│ │ ├─ Yes ────────► Assign num to smallest_num
│ │ └─ No
│ ├─ Is num > largest_num?
│ │ ├─ Yes ────────► Assign num to largest_num
│ │ └─ No
│ └─ Read num
└───────────────────► Restart

END

Sure! Here's the pseudocode and flowchart for the "Largest and Smallest" program:

Pseudocode:

1. Initialize variables: largest = smallest = None
2. Display message: "Enter a series of numbers (enter -99 to stop):"
3. Read user input into variable 'number'
4. while 'number' is not equal to -99:
a. if 'largest' is None or 'number' is greater than 'largest':
i. set 'largest' equal to 'number'
b. if 'smallest' is None or 'number' is less than 'smallest':
i. set 'smallest' equal to 'number'
c. Read next user input into variable 'number'
5. Display message: "Smallest number entered: 'smallest'"
6. Display message: "Largest number entered: 'largest'"
7. End program

Flowchart:

```
-----------------------
| Start of program |
-----------------------
|
|
v
--------------------------
| Display input message |
--------------------------
|
|
v
-------------------------------
| Read number from user input |
-------------------------------
|
|
v
--------------------
| Check if number is |
| -99 (end signal) |
--------------------
|
v
----------
| No |
----------
|
|
v
--------------------------
| Check if largest is None |
| or number > largest |
--------------------------
|
v
---------------
| Yes |
---------------
|
|
v
--------------------------------
| Set largest = number |
--------------------------------
|
|
v
-------------------------------
| Check if smallest is None |
| or number < smallest |
-------------------------------
|
v
---------------
| Yes |
---------------
|
|
v
---------------------------------
| Set smallest = number |
---------------------------------
|
|
v
-------------------------------------------------
| Read next number from user input |
-------------------------------------------------
|
|
v
--------------------------
| Check if number is |
| -99 (end signal) |
--------------------------
|
v
--------------
| Yes |
--------------
|
|
v
---------------------
| Display smallest |
---------------------
|
|
v
--------------------
| Display largest |
--------------------
|
|
v
----------------------
| End of program |
----------------------
```

This pseudocode and flowchart will help you create a program that asks the user for a series of numbers, stores the largest and smallest numbers entered, and then displays them after the user enters -99 to signal the end of the series.