Answer to Question #316689 in C++ for Angelo

Question #316689

#include <iostream>

#include <string>

using namespace std;

struct book

{

string title;

string author;

unsigned int year;

};

int main()

{

book bookrec;

cout << “Enter Book Title:”; getline(cin,bookrec.title);

cout << “Enter Book Author:”; getline(cin,bookrec.author);

cout << “Enter Publication Year:”; cin >> bookrec.year;

cout << “The following information has been received…\n”);

cout << “Book Title:” << bookrec.title;

cout << “Book Author:” << bookrec.author;

cout << “Year Published:” << bookrec.year << “\n”;

system(“pause”);

return 0;

}


1
Expert's answer
2022-03-23T16:18:14-0400
#include <iostream>
#include <string>

using namespace std;

struct book {

string title;

string author;

unsigned int year;

};

int main() {

book bookrec;

cout << "Enter Book Title:";  getline(cin,bookrec.title);

cout << "Enter Book Author:";  getline(cin,bookrec.author);

cout << "Enter Publication Year:"; cin >> bookrec.year;

cout << "The following information has been received…\n";

cout << "Book Title:" << bookrec.title;

cout << "Book Author:" << bookrec.author;

cout << "Year Published:" << bookrec.year << "\n";

system("pause");

return 0;

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog