Hey there!! :) I want to develop a Program for a Android Phone App for a school
ID: 3756133 • Letter: H
Question
Hey there!! :) I want to develop a Program for a Android Phone App for a school project. The Project is a Buy and Sell Books for a University. The goal is that student can look for books to buy and also be able to post a book to sell. Can you help me with a code (preferably made in C, C++, Python or Javascript).
App must have a welcome screen saying, "Welcome, please select an option:
1. Buy Book
2. Sell Book
3. Close App"
In the "Buy Book" category, the user can search for book.
In the "Sell Book" catergory, the user can be able to post information about a book to be sold. Information should be as follows:
Name of the book
Picture of the Book
Authour of book
Year it was Published
Date it was bought
Subject
Amount the person wants to sell the book for
Email Address and Phone Number of Seller (Message must say: "If you are interested in buying you can contact me at:.............................................................." )
Thank You.
Explanation / Answer
#include<iostream>
#include<stdlib.h>
#include<cstring>
using namespace std;
class Book
{
char picture[20],author[20],date[20],subject[20];
int year;
float amount;
public:
char name[20];
/*Book(char *n,char *p,char *a,char *d,char* s,int y,float am)
{
strcpy(name,n);
strcpy(picture,p);
strcpy(author,a);
strcpy(date,d);
strcpy(subject,s);
year = y;
amount = am;
}*/
void display()
{
cout<<"Name = "<<name<<endl;
cout<<"Picture = "<<picture<<endl;
cout<<"Author = "<<author<<endl;
cout<<"Date = "<<date<<endl;
cout<<"Subject = "<<subject<<endl;
cout<<"Year = "<<year<<endl;
cout<<"Amount = "<<amount<<endl;
}
void accept()
{
cout<<"Enter Name of Book";
cin>>name;
cout<<"Enter Pictuer Path";
cin>>picture;
cout<<"Enter Author Name";
cin>>author;
cout<<"Enter Date";
cin>>date;
cout<<"Enter Subject";
cin>>subject;
cout<<"Enter Year";
cin>>year;
cout<<"Enter Amount";
cin>>amount;
}
};
main()
{
//Book b("PHP","D:abc.pdf","ABC","12-2-2018","AA",2018,210);
//b.display();
char bname[20];
int choice;
char email[20],phone[20];
Book b[20];
int cnt=0;
do
{
cout<<"1.Buy"<<endl;
cout<<"2.Sell"<<endl;
cout<<"3.Exit"<<endl;
cout<<"Enter your Choice";
cin>>choice;
switch(choice)
{
case 1:cout<<"Enter Book Name to be Searched";
cin>>bname;
int i;
for(i=0;i<cnt;i++)
{
if(strcmp(b[i].name,bname)==0)
{
b[i].display();
break;
}
}
if(i==cnt)
cout<<"Book Not Found"<<endl;
else
cout<<"Do you want to Buy this book? Pls Contact at -------"<<endl;
break;
case 2:
b[cnt].accept();
cnt++;
cout<<"Enter Email ID ";
cin>>email;
cout<<"Enter Phone No";
cin>>phone;
break;
case 3:exit(0);
}
}while(choice!=3);
}