CS1411 - 160 - Programming Principles I, Spring 2005

Lab assignment 7

Motivation

This weeks you will practice struct

Mandatory work

Your TA will check that you have done the following things (you may leave once their done) :

Define a struct

Define a struct that has at least 3 members. An example would be an inventory system with name (string), inventory number (int) and count (int).

Provide input/output functions

Write an input function that can be used to read in a variable of your struct type

Also, write an output function that can be used to print a variable of your struct type to the screen

Test it!

Write a main function that can be used to test your functions. Do not use global variables! (However, your struc type is probably global!)

How?

Please check the labs page on how to get started. There are instructions for visual studio (use version 6) and XCode

Please give the Macs a try. If you simply cannot work with them, go to PE 119, but let your TA know.

Sample programs

have moved to the examples page

Help!

For help: ask your TA! He is here to help you!

If the instructions are unclear or you have any other questions, please email me