C++ PRPGRAM- double-linked lists
Create the .h and .cpp files for an Element class that contains the data and pointers for a double-link list for this application. Your linked list must consist of objects of this class. The class should contain at least the following elements (you may have more if you wish):
The instance variables must be pointers, and they must be private.
Create the .h and .cpp files for a List class that implements the List ADT for objects of the Element class in a double-linked list. The List class must contain at least the following elements (you may have more if you wish):
The instance variables must be pointers, and they must be private.
create main.h and main.cpp source code files that contains the C++ source code for a program that
Getting the file from the user
using namespace std;
int main() {
string filename = "abc.txt";
// Write to File
ofstream fout(filename.c_str());
if (!fout) {
cerr << "error: open file for
output failed!" << endl;
abort();
}
fout << "apple" << endl;
fout << "orange" << endl;
fout << "banana" << endl;
fout.close();
// Read from file
ifstream fin(filename.c_str());
if (!fin) {
cerr << "error: open file for
input failed!" << endl;
abort();
}
char ch;
while (fin.get(ch)) { // till end-of-file
cout << ch;
}
fin.close();
return 0;
}
C++ PRPGRAM- double-linked lists Create the .h and .cpp files for an Element class that contains...
1a. Create a class named Computer - Separate declaration from implementation (i.e. Header and CPP files) 1b. Add the following private member variables - an int variable named year - a string variable named model - a string variable named purpose 1c Add the following public functions: - Default constructor which sets numeric members to -1 and string members to the empty string - Destructor to print "Removing instance from memory" - A non-default constructor to set the year and...
1a. Create a class named Inventory - Separate declaration from implementation (i.e. Header and CPP files) 1b. Add the following private member variables - a int variable named itemNumber - an int variable named quantity - a double variable named cost - a double variable named totalCost. Total cost is defined as quantity X cost. - updateTotalCost() which takes no arguments and sets the values of the variable totalCost. 1c. Add the following public functions: - Accessor and Mutators for...
Provide code and full projects neatly and in proper form and in the correct header and cpp files((we have to make 3 files header file , one .cpp file for function and one more main cpp file) Operator Overloading – Chapter 14 Design a class Complex for representing complex numbers and the write overloaded operators for adding, subtracting, multiplying and dividing 2 complex numbers. Also create a function that will print a complex number on the screen. Provide appropriate constructors...
Create a cpp file that contains a constructor and destructor of a node in a circular doubly-linked list using the following header file: class CDLLNode { private: // these will contain the timestamp and content of the tweet as strings std::string time; std::string tweet; // these are pointers to the next and previous nodes in the CDLL CDLLNode *next; CDLLNode *prev; public: CDLLNode(const char *ti, const char *tw); ~CDLLNode(); friend class CDLL; };
Provide code and full projects neatly and in proper form and in the correct header and cpp files((we have to make 3 files header file , one .cpp file for function and one more main cpp file) Operator Overloading – Chapter 14 Design a class Complex for representing complex numbers and the write overloaded operators for adding, subtracting, multiplying and dividing 2 complex numbers. Also create a function that will print a complex number on the screen. Provide appropriate constructors...
Part (A) Note: This class must be created in a separate cpp file Create a class Employee with the following attributes and operations: Attributes (Data members): i. An array to store the employee name. The length of this array is 256 bytes. ii. An array to store the company name. The length of this array is 256 bytes. iii. An array to store the department name. The length of this array is 256 bytes. iv. An unsigned integer to store...
Create a class called Retangle.java that contains two double-precision instance variables named width and height. The class should include all kinds of overloaded constructors. Additionally, there should be two accessor methods, mutator methods, class method named area() that returns the area of a Rectangle object. Inside main(),fully test all methods.
in C++, please help. Not only do we need to create an ADT but create a main file as well to implement everything. For this program you will be creating a stack ADT to allow the client program to pick up treasures for a Star Wars scavenger game to get everyone ready for the opening of Galaxy’s Edge in 2020. Each treasure should have a (a) name, (b) description, (c) category, (d) what it is used for, and (e)if this...
Need help to create general
class
Classes Data Element - Ticket Create an abstract class called Ticket with: two abstract methods called calculateTicketPrice which returns a double and getld0 which returns an int instance variables (one of them is an object of the enumerated type Format) which are common to all the subclasses of Ticket toString method, getters and setters and at least 2 constructors, one of the constructors must be the default (no-arg) constructor. . Data Element - subclasses...
Design a class that contains: we have to make 3 files header file , one .cpp file for function and one more main cpp file 9.3 (The Account class) Design a class named Account that contains: An int data field named id for the account. A double data field named balance for the account. A double data field named annualInterestRate that stores the current interest rate. A no-arg constructor that creates a default account with id 0, balance 0, and...