Professional Documents
Culture Documents
home / study / engineering / computer science / computer science questions and answers / question 1: recommender system you are required to …
Question: Question 1: Recommender System You are required to make a… Post a question
Answers from our experts for your tough
homework questions
Continue to post
1 question remaining
888-888-8888 Text me
My Textbook Solutions
Expert Answer
#include <iostream>
#include <string>
#include <algorithm>
#include <random>
#include <vector>
class Customer
{
static int _ID;
int m_id;
string m_name;
public:
Customer(string name)
{
m_id = _ID++;
m_name = name;
}
const string& getName() const
{
return m_name;
}
class Item
{
static int _ID;
int m_id;
string m_name;
int m_category;
public:
Item(string name, int category)
{
m_id = _ID++;
m_name = name;
m_category = category;
}
class Store
{
Customer** m_customers;
Item** m_items;
int m_cus_count;
int m_item_count;
vector<vector<int>> record;
public:
Store(Customer** cus, Item** items, int cc, int ic)
{
this->m_customers = cus;
this->m_items = items;
this->m_cus_count = cc;
this->m_item_count = ic;
void DisplayAllItems()
{
for (int i = 0; i < m_item_count; ++i)
cout << *(m_items[i]) << endl;
cout << endl;
}
~Store()
{
for (int i = 0; i < this->m_item_count; ++i)
delete m_items[i];
// initialise IDs
int Customer::_ID{ 0 };
int Item::_ID{ 0 };
return customers;
}
// shuffle categories
shuffle(arr, arr + item_count, default_random_engine(0));
delete[] arr;
return items;
}
int main()
{
int cus_count;
int item_count;
do
{
cout << "Menu" << endl;
cout << "1. View all items" << endl;
cout << "2. View purchase history" << endl;
cout << "3. View recommend items" << endl;
cout << "4. Login as new customer" << endl;
cout << "5. Purchase Item" << endl;
cout << "6. Exit" << endl;
case 2:
if (cur_customer < 0 || cur_customer >= cus_count)
cout << "Kindly login rst" << endl;
else
s.ViewHistory(cur_customer);
break;
case 3:
if (cur_customer < 0 || cur_customer >= cus_count)
cout << "Kindly login rst" << endl;
else
s.ViewRecommendations(cur_customer);
break;
case 4:
cout << "Enter new customer ID: ";
int temp;
cin >> temp;
case 5:
if (cur_customer < 0 || cur_customer >= cus_count)
cout << "Kindly login rst" << endl;
else
{
int pid;
cout << "Enter Item ID: ";
cin >> pid;
if (pid < 0 || pid >= item_count)
cerr << "Invalid Item ID" << endl << endl;
else
s.Puchase(cur_customer, pid);
}
break;
}
} while (selection != 6);
return 0;
}
A: See answer
Q: Write a code in c++ Question 1: Recommender System You are required to make a very simple recommender system
for an online store. When a customer buys an item from the store, your system should maintain the history, i.e., that
customer X bought item Y. Next time the customer logs into the store, they should see items related to the one they
bought. For representing relatedness...
Q: Write a code in c++ Question 1: Recommender System You are required to make a very simple recommender system
for an online store. When a customer buys an item from the store, your system should maintain the history, i.e., that
customer X bought item Y. Next time the customer logs into the store, they should see items related to the one they
bought. For representing relatedness...
Q: Question 3: Calendar Application (write code in c++) In this program, you will develop a calendar application that can
display the full calendar for any month of any year and allow the user to add notes against any date. Implement the
following functionality: 1. Display calendar for any month of any year 2. Add a note against any date 3. View all notes
sorted by date 4. Edit or...
A: See answer
Show more
COMPANY LEGAL & POLICIES CHEGG PRODUCTS AND SERVICES CHEGG NETWORK CUSTOMER SERVICE
About Chegg Advertising Choices Cheap Textbooks Mobile Apps EasyBib Customer Service
Chegg For Good Cookie Notice Chegg Coupon Sell Textbooks Internships.com Give Us Feedback
College Marketing General Policies Chegg Play Solutions Manual Thinkful Help with eTextbooks
Corporate Development Intellectual Property Rights Chegg Study Help Study 101 Help to use EasyBib Plus
Investor Relations Terms of Use College Textbooks Textbook Rental Manage Chegg Study
Jobs Global Privacy Policy eTextbooks Used Textbooks Subscription
Join Our Affiliate Program DO NOT SELL MY INFO Flashcards Digital Access Codes Return Your Books
Media Center Honor Code Learn Chegg Money Textbook Return Policy