Homework 4

This homework is worth 5 points.

When you finish this assignment you should be able to :

Rewrite program Three To take input from a file.

You should change the main routine to open a file called items.dat. This file containing a list of items to be placed in grandmother's trunk, one item per line. Your program should read in each item and print the story so far, until it encounters the end of the file.

If the input file contained

box of apples
big wiggly spider
walking stick
rock
The output should look like this:
In my Grandma's trunk I found a box of apples. 
In my Grandma's trunk I found a box of apples and a big wiggly spider. 
In my Grandma's trunk I found a box of apples and a big wiggly spider and a walking stick. 
In my Grandma's trunk I found a box of apples and a big wiggly spider and a walking stick and a rock. 
The file will contain at least one line, but it may contain many lines (not just four).

Once you have a working program, email the program to danbennett360@gmail.com. Please attach the source code file to your message. Please DO NOT send the executable file.