[Solved] CSCI204/MCS9204/CSCI804 Object and Generic Programming in C++ Laboratory Exercise 1 (Week 2)

$25

File Name: CSCI204/MCS9204/CSCI804_Object_and_Generic_Programming_in_C++_Laboratory_Exercise_1_(Week_2).zip
File Size: 866.64 KB

SKU: [Solved] CSCI204/MCS9204/CSCI804 Object and Generic Programming in C++ Laboratory Exercise 1 (Week 2) Category: Tag:
5/5 - (1 vote)

5/5 – (1 vote)

Task: Functions and File I/O (1.0)Define a structure Pet consist data fields: status (lost or found), pet type, gender, breeds, age of year, age of month, colour, chip number, location, contact phone number in a file pet.h.Define functions prototypes and other necessary definitions in the file pet.h.The data fields types are decided by you.Implement a function countRecords(char *) in a file pet.cpp that can return how many records of pets in a given text file. Implement a function loadRecords(char *, Pet *, int) load the pet records in a dynamic Pet array from the given text file. Implement a function printRecords(Pet *, int) print out all the pet records.The example file pets.dat of pet records can be downloaded from the site of the lab task.Each record stored in one line, different data fields separated by commas except the last field.There might be some empty lines in a given text file. The empty lines cannot be count as the records.Implement driver program in the main function in pet.cpp to get the input text file name from a user, print out number of pet records that stored in the file, load pet records and print out all the data that loaded.Dont forget to delete the dynamic pet record array before the program finished.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CSCI204/MCS9204/CSCI804 Object and Generic Programming in C++ Laboratory Exercise 1 (Week 2)
$25