Question: please include a loop to see if the file can open or not 1.) Create a new C++ project and name it as: Cats 2.)

please include a loop to see if the file can open or not

please include a loop to see if the file can open or

1.) Create a new C++ project and name it as: Cats 2.) Create a Source.cpp file. 3.) Declare a struct named Cat. (in the Source.cpp file, or in a separate header file) 4.) Each Cat object has a name and age. The name data member is a c_string. The age data member is an integer. 5.) Ask the user to enter 3 cats. 6.) Use a while loop to read the information about one cat entered by the user, and write it to a binary file named: critters.bin - Only one Cat object needs to be declared, because the same object can be used for each cat. Use the write() function to write the data to a binary file. The while loop should only execute 3 iterations. 7.) Once the file has been written, the following message should be displayed: Record written to file. (see output) 8.) Turn in a screen print of the binary file, as shown below, along with your code and output. / * OUTPUT Enter 3 cat records. Enter information about a cat: NAME : Tom AGE : 5 Enter information about a cat: NAME : Fluffy AGE : 3 Enter information about a cat: NAME : Sweet Pea AGE : 2 Record written to file. Press any key to continue . * /

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!