Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program read a input file and store the information in a class object be

ID: 3589804 • Letter: W

Question




Write a program read a input file and store the information in a class object below: class Person public: PersonO Write any other functions that are needed int presidency, birthYear, deceasedYear private: string name, startDate, endDate, party You program must have the following: Must include your name as part of the program output (Use the PrintMeFirst function) .You must include the program outputs in a single pdf file by itself. . You must separate your class object h definition header file from your implementation file (.cpp file for the .h definition) (See the makefile example in the winedb directory of the Ubuntu image OS on how to compile multiple files.) You must include all the source files (you can include in a zip file). However, the program output file (PDF) must be submitted as first file and then the zip file .

Explanation / Answer

#include #include // For exit() function int main() { char c[1000]; FILE *fptr; if ((fptr = fopen("program.txt", "r")) == NULL) { printf("Error! opening file"); // Program exits if file pointer returns NULL. exit(1); } // reads text until newline fscanf(fptr,"%[^ ]", c); printf("Data from the file: %s", c); fclose(fptr); return 0; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote