Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// // main.cpp //struct homework #include #include using namespace std; struct book { string title; string author; string numPages; }; int main () { cout

//

// main.cpp

//struct homework

#include

#include

using namespace std;

struct book

{

string title;

string author;

string numPages;

};

int main ()

{

cout

cout

cout

cout

book novel;

novel.title = "Beginning of the END";

novel.author = "John Hagee";

novel.numPages = "196";

cout

cin.get();

return 0;

}

that's my struct.

how do I transform my struct into class

image text in transcribed

code need to be in c++

Data Structures Class Homework - Due date: 28 Feb Transform your Struct into a Class Your class must have at least: one setter for each field one getter for each field two fields (variables) Crate an instance of your class and demonstrate its features

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions