Lab Assignment--HAL Program


HAL Program

DRAFT

Part 1

Modify the arrayInputOutput code from the notes so that instead of reading five integers from the keyboard, you are reading 12 floats from a hardcoded file called "inputFile.txt"

Part 2

Add a function called averageArray the details are below:

The file that you can use to test your code is here: inputFile.txt. Don't forget to specify the directory for the file when you type the name as input.

A sample run might look like this:

a049403[36]% HALstart

HALstart: powering up HAL9000 ...
set: No match.
HALstart: HAL9000 OK
HAL9000: initializing ...
HAL9000: boot sequence started ...
HAL9000: loading HALbios ...
HAL9000: HALbios OK
HALbios: initializing ...
HALbios: checking memory ...
HALbios: memory OK
HALbios: loading HALos ...
HALbios: HALos OK
HALos: initializing ...
HALos: loading HALshell ...
HALos: HALshell OK
HALshell: initializing ...

HALshell> compile nova/labAssignGood.hal
HALshell> nova/labAssignGood.hal
Values are:
99.9
88.8
25.5
21.8
15.6
14.4
16.3
10.2
8.9
6.7
4.5
3.2
The average is: 26.3167
HALshell> shutdown

HALshell: terminating ...
HALos: terminating ...
HAL9000: powering down ...
a049403[37]% 

Deliverables:

  1. Code
  2. Script of Run through HALShell

Notes