Help in homework
$10-30 USD
Paid on delivery
Hello I have homework I do not where is the error in the program
#include <iostream>
#include <cstring>
using namespace std;
class book
{
private:
char name[25];
int pages = 1;
char auther[25];
char publisher[25];
public:
void setname(char n[])
{strncpy(name, n,strlen(n));}
int setpage(int n) {pages=n;}
void setauther(char n[])
{strncpy(auther, n,strlen(n));}
void setpublisher(char n[])
{strncpy(publisher, n,strlen(n));}
char* getname() {return name;}
int getpage() {return pages;}
char* getauther() {return auther;}
char* getpublisher() {return publisher;}
};
int main()
{
book books[5];
books[1].setname("colors");
books[2].setname("be rich");
books[3].setname("stay strong");
books[4].setname("lose fat");
books[5].setname("Dance\n");
books[1].setpage(11);
books[2].setpage(1);
books[3].setpage(5);
books[4].setpage(6);
books[5].setpage(4);
books[1].setauther(" Mohammed ");
books[2].setauther(" Ahmed ");
books[3].setauther(" Ali ");
books[4].setauther(" Tallal ");
books[5].setauther(" Faisal ");
books[1].setpublisher(" ALNASHER ");
books[2].setpublisher(" ALKALAM ");
books[3].setpublisher(" SA'AEE ");
books[4].setpublisher(" ALNSHRH ");
books[5].setpublisher(" TBQ ");
for (int i=1;i<=5;i++)
{
cout <<"Name: " << books[i].getname() << " pages: " << books[i].getpage() << " The Authers: " << books[i].getauther()
<< " The Publisher: " << books[i].getpublisher() << "\n";
}
return 0;
}
Project ID: #18303309
About the project
15 freelancers are bidding on average $22 for this job
Hi there, I do C++ programming and I would like to do this project if given the opportunity. Let me know if you are interested so I can have the complete details with regards to your code.
Hi I will help you as one of C++ expert. Please contact me and let's discuss in detail over chatting. Thank you for your reading. Best regards.
-------------------------------Best result on time && Master in C++ and Algorithm!------------------------------------- Hello, dear! I have read your proposal and I am very interesting in your project. I have good e More
Hi. There are a couple of errors in your file. I can fix them in a short time. Message me if you are interested for me to do this for you. Do you need anything else besides this?
I have found that error. Hello. How are you I read your description carefully. Very Interesting. I will help you via anydesk. I have many experiences in C++. So I can fix your error immediately. I can do it. More
Hello brother, let me help you with your homework. i found the error as well. ita just a small mistake. Let's chat and solve your problem. best regards, faizal
Hey I'm a System Engineer with coding skills. I have the required skills and experience. Were you trying to run the C++ code on Windows or Linux? Share more details please.
Hello, i am an Msc computer science student and an expert c++ developer. I can help you with this homework and complete it within an hour from the time you award me this task Lets discuss Thanks
Hello. I am good with C/C++ Programming. I can help you either to modify your code or write a new code for your homework. Please give more details via chat. Thanks.
I can see a problem right away. ....................................................................
Hello, I'm C++ developer with 4 years experience, I participate in lots of competition and I solved a lot of same problems, so don't worry about anything. Let's chat to more details
I've read your code and I'm ready to help you. I have been wprking with C++ for about 4 years and I'm trying to get my first job on this website.