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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:00
We as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in a computer’s language, however, it is preferred to have the operators on the right side of the operands, i.e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix.write a program that takes an “infix” expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
You have been supporting csm tech publishing's windows server 2016 server network for over a year. the office has two windows server 2016 servers running active directory and a number of other roles. management has informed you that a small sales office is opening in the same building three floors up. the sales manager wants to install a sales application on a server located in the sales office. this server will have limited physical security because there's no special room dedicated for it, which means it will be accessible to non-it personnel and visitors. you're considering installing windows server 2016 server core on the new server because accessing its console regularly probably won't be necessary, and this server will be managed from one of the other csm tech publishing servers. what are the benefits and drawbacks of using server core for this branch office? what are some things you should do to set up this server management environment?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
Companies that implement and apply an information system effectively can create
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
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
question
Mathematics, 30.11.2021 05:00
question
Mathematics, 30.11.2021 05:00