subject

Write a struct object to a binary file 1.) Include the following in the driver. cpp file (in the Cats project above)
2.) Prompt the user to enter one more cat record, and then write the data to the critters. bin file. Include code so that when the data is written to file, it is appended (added on to the - end of the existing data).
3.) After the new cat has been written to file, use a while loop to read the critters. bin file and display all four records. - With each iteration, one cat object should be read and then displayed on the screen. - Set the while loop to execute four iterations.
4.) Open the critters. bin file and verify that the file was written successfully - Use the setw0 function to output the name and age in columns. (see output) - What library does setw) require? - Does setw) align left or right? Note: To change output to left align: cout << setw(10) << left << cat. name;
5.) 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 Enter one more cat NAME: Jasmin AGE: 4 Here is a list of all cats: Tom Fluffy 3 Sweet Pea 2 Jasmin 4 Press any key to continue.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:30, chaparro0512
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the student’s id and a total bill. • bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
image
Computers and Technology, 23.06.2019 09:30, cdavis379
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a. if the manual switch s is on, then the light l is on. b. besides the manual switch, there is a motion detector, m1, which activatesthis light. c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d. the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
image
Computers and Technology, 23.06.2019 18:20, Blossom824
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
image
Computers and Technology, 24.06.2019 10:20, savyblue1724707
Identify the publisher in this citation: carter, alan. a guide to entrepreneurship. new york: river’2008.print.
Answers: 3
You know the right answer?
Write a struct object to a binary file 1.) Include the following in the driver. cpp file (in the Ca...

Questions in other subjects: