Cal Poly CPE 101 - lab 07 (6 pages)

Previewing pages 1, 2 of 6 page document View the full content.
View Full Document

lab 07



Previewing pages 1, 2 of actual document.

View the full content.
View Full Document
View Full Document

lab 07

108 views

Lecture Notes


Pages:
6
School:
California Polytechnic State University
Course:
Cpe 101 - Fundamentals of Computer Science
Fundamentals of Computer Science Documents

Unformatted text preview:

CPE 101 Winter 2009 Laboratory 7 Due Date By the end of your last scheduled lab of week eight You must turn in your source electronically on vogon using the handin command instructions are provided in below Objectives To experience and understand records structures in C To learn about and create arrays of records To practice using FILE I O To practice developing functions to sort array data To develop a complete a C program compile it and turn it in electronically Resources Your instructor peers texts and your own innate capabilities and resourcefulness Orientation This lab will involve developing a small C program which handles data about planets You will be creating your own type a record structure in order to store the planet information for our solar system You will need to develop a variety of functions to process this data Part 0 Creating the data type and reading in data Recall that in order to define your own data type you will need to specify typedef struct variables associated with the structure name of record Start out by defining a structure to store planet data Name this data type planetData This structure must include A planet name 80 char maximum The planet s equatorial diameter km The planet s distance to the Earth km The number of natural satellites i e moons the planet has You will also be writing a variety of functions which operate on arrays of planetData At this time just develop A function to print out the data for each planet data in the array See below for examples Now write a main function which creates an array of planetData Note that there are nine planets in our solar system Write the appropriate code to parse the planet data from an input file named planet data found in the class examples directory and store it in the array of planetData Once the data has been stored call your print routine in order to print out the data After reading the input file the output of your print routine should look like this Planet 0 name Mercury diameter



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view lab 07 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view lab 07 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?