I have been given an assignment from my uni to create a bank where im to have customers with multiple accounts and different account types, also then add other things like loans etc.
Im having problems getting a linked list to work with the class objects. my aim is to store all the customers details, and account details in the class objects then list all the customers in the linked list instead of using something like an array as we get more marks for using linked lists.
so far i have managed to get it so the customer can be created and pointing to just one account. but i am stuggling with understanding how im to then create the linked list so it connects to the class object.
these are some bits of the code which i have so far:
with this im not sure if im doing it the correct way, but am i to create the objects then pass in the refference to it, which is then stored in the linked list?
CustomerList.cpp
#include "CustomerList.h"
#include <iostream>
using namespace std ;
CustomerList::CustomerList()
{
front = back = 0;
}
bool CustomerList::isEmpty()
{
return front == 0;
}
void CustomerList::addCustomer(Customer *tempCustomer)
{
Node* insert = new Node(tempCustomer);
if (front == 0)
{
back = front = insert;
}
else
{
back-> next = insert ;
back = back -> next ;
}
}
CustomerList::removeCustomer()
{
Customer tempCustomer; Node* temp;
if (front != 0)
{
tempCustomer = front -> customerRef;
temp = front;
front = front -> next ;
delete temp ;
if (front == 0) back = 0;
return tempCustomer;
}
else return '\0';
}
CustomerList::~CustomerList()
{
Node * temp;
while(front != 0)
{
temp = front;
front = front -> next;
delete temp;
}
}
void CustomerList::print()
{
Node * temp = front;
if (temp != 0 )
{
while (temp != 0)
{
cout << temp -> customerRef.getName() ;
temp = temp -> next;
}
}
else cout << "empty";
cout << endl;
}
Not only its still 3 Euros listed for me but it doesn't seem to even support newer versions of Android, it just tells me it's incompatible with my device. EP2 works.
I have seen what it takes to uninstall co-pilot, it is not elegant and certainly not a straight forward Uninstall. Can't they just do what Apple have done, and just have a setting to turn it off?
i don't get all this pushing/forcing to get people to use Ai or get people to have accounts and that sort of thing. If people want to use the services, then they will, they don't need pushing.
They push/force, then they get people like me who looks on it with suspicion and find anyway to disable or not use the service
So what happens when all These AI services have grabbed all the data from humans and have to then start grabbing data a from other AIs?
So we will get more false info made up by machines, I feel sorry for the younger generation, they will not know what is real and what is not.
It can be done, I have done it in the past, but Windows goes wild getting new drivers and moving stuff around. I think it is better these days, but as other have said, always better to do a fresh installation.
Question
soil
I have been given an assignment from my uni to create a bank where im to have customers with multiple accounts and different account types, also then add other things like loans etc.
Im having problems getting a linked list to work with the class objects. my aim is to store all the customers details, and account details in the class objects then list all the customers in the linked list instead of using something like an array as we get more marks for using linked lists.
so far i have managed to get it so the customer can be created and pointing to just one account. but i am stuggling with understanding how im to then create the linked list so it connects to the class object.
these are some bits of the code which i have so far:
AssignmentBank.cpp (main)
with this im not sure if im doing it the correct way, but am i to create the objects then pass in the refference to it, which is then stored in the linked list?
CustomerList.cpp
CustomerList.h
any help at all would be useful.
I have gone to extra classes at uni and asked lecturers over and over but they dont seem to be helping me much.
Link to comment
https://www.neowin.net/forum/topic/955220-c-linked-list-and-objects/Share on other sites
7 answers to this question
Recommended Posts