hrstar24
March 31st, 2008, 12:16 PM
Ok, so my entire grade in my C++ class depends on whether i can pass this basic skills test or not, and i'm hoping you guys can give me some helpful pointers and tips to pass this. Here is all the info
The skills test will be offered in lab (and possibly in some evening
sessions in the final week of the course.) You can take it as many
times as needed, but not more than once on the same day. You will
have 50 minutes to write a working program that solves an
assigned problem in which you read information from a file,
containing character strings and numbers, store the information in
an array, and perform one of the following operations:
*print the average value of entries in the data set
*prompt the user for a descriptor and print the corresponding
value, or print ģinvalid descriptorī
*print the max value of entries in the data set
*print the min value of entries in the data set
*prompt the user for a descriptor and delete the corresponding
descriptor and value, or print ģinvalid descriptorī, and print the remaining entries in the data set
*prompt the user for a descriptor and value, add these to the data
set, and print the entries, including the new one
You will be told which of these things you have to do.
The file will contain a number of records, where each record
consists of a descriptor and an associated value, such as:
candidate name, vote (eg Nixon 200)
state, sales volume (eg Colorado 150)
month, average temperature (eg January 43.5)
part number, quantity (eg A34B2 250)
city, population (eg Denver 100200)
name, grade (eg Smith 93)
tooth, length (eg canine 34.2)
Your program must be able to read and store as many records as
there are in the file, up to some stated limit, without assuming how
many records are in the file.
Your program must define an use at least one appropriate struct
type, and at least one function other than main.
Any tips are greatly appreciated. I specifically need help on being able to read in the data files, which will contain like a name, then the value there. What functions should i use to read in this data and store it into an array?
The skills test will be offered in lab (and possibly in some evening
sessions in the final week of the course.) You can take it as many
times as needed, but not more than once on the same day. You will
have 50 minutes to write a working program that solves an
assigned problem in which you read information from a file,
containing character strings and numbers, store the information in
an array, and perform one of the following operations:
*print the average value of entries in the data set
*prompt the user for a descriptor and print the corresponding
value, or print ģinvalid descriptorī
*print the max value of entries in the data set
*print the min value of entries in the data set
*prompt the user for a descriptor and delete the corresponding
descriptor and value, or print ģinvalid descriptorī, and print the remaining entries in the data set
*prompt the user for a descriptor and value, add these to the data
set, and print the entries, including the new one
You will be told which of these things you have to do.
The file will contain a number of records, where each record
consists of a descriptor and an associated value, such as:
candidate name, vote (eg Nixon 200)
state, sales volume (eg Colorado 150)
month, average temperature (eg January 43.5)
part number, quantity (eg A34B2 250)
city, population (eg Denver 100200)
name, grade (eg Smith 93)
tooth, length (eg canine 34.2)
Your program must be able to read and store as many records as
there are in the file, up to some stated limit, without assuming how
many records are in the file.
Your program must define an use at least one appropriate struct
type, and at least one function other than main.
Any tips are greatly appreciated. I specifically need help on being able to read in the data files, which will contain like a name, then the value there. What functions should i use to read in this data and store it into an array?