Faria R.

asked • 07/12/21

modify the code so i can submit it without plagiarism

Main.cpp
#include "Unsortedtype.h"
using namespace std;

class StudentInfo {
private:
int id;
std::string name;
float cgpa;
public:
StudentInfo();
StudentInfo(const int&, const std::string&, const float&);
friend std::ostream& operator<< (std::ostream& out, const StudentInfo& std);
friend bool operator== (const StudentInfo& std1, const StudentInfo& std2);
};

StudentInfo:: StudentInfo() {
id = 0;
name = "";
cgpa = 0;
}

StudentInfo:: StudentInfo(const int& a, const std::string& b, const float& c) {
id = a;
name = b;
cgpa = c;
}

std::ostream& operator<< (std::ostream& out, const StudentInfo& std) {
out << std.id << ' ' << std.name << ' ' << std.cgpa;
return out;
};

bool operator== (const StudentInfo& std1, const StudentInfo& std2) {
return std1.id == std2.id;
}

Faria R.

the last part of these code int main() { UnsortedType l; if(l.isEmpty()) { cout << "List is empty" << endl; } else { cout << "List is not empty" << endl; } l.InsertItem(5); l.InsertItem(7); l.InsertItem(6); l.InsertItem(9); if(l.isEmpty()) { cout << "List is empty" << endl; } else { cout << "List is not empty" << endl; } if(l.isFull()) { cout << "List is full" << endl; } else { cout << "List is not full" << endl; } l.printList(); cout << l.LengthIs() << endl; l.InsertItem(1); l.printList(); bool f; l.RetrieveItem(4, f); if(f) { cout << "It is found" << endl; } else { cout << "It is not found" << endl; } l.RetrieveItem(5, f); if(f) { cout << "It is found" << endl; } else { cout << "It is not found" << endl; } l.RetrieveItem(9, f); if(f) { cout << "It is found" << endl; } else { cout << "It is not found" << endl; } l.RetrieveItem(10, f); if(f) { cout << "It is found" << endl; } else { cout << "It is not found" << endl; } if(l.isFull()) { cout << "List is full" << endl; } else { cout << "List is not full" << endl; } l.DeleteItem(1); l.printList(); l.DeleteItem(7); l.printList(); UnsortedType l2; StudentInfo a(15234, "Jon", 2.6), b(13732, "Tyrion", 3.9), c(13569, "Sandor", 1.2), d(15467, "Ramsey", 3.1), e(16285, "Arya", 3.1); l2.InsertItem(a); l2.InsertItem(b); l2.InsertItem(c); l2.InsertItem(d); l2.InsertItem(e); l2.printList(); l2.DeleteItem(d); l2.RetrieveItem(c, f); if(f) { cout << "It is found" << endl; cout << c << endl; } else { cout << "It is not found" << endl; } l2.printList(); }
Report

07/12/21

1 Expert Answer

By:

Patrick B. answered • 07/13/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.