COEN 244 (Summer XXXXXXXXXXAssignment 3 Group Assignment (1 or 2 members) Submission The submission must be through Moodle on the submission link for Programming Assignment 1. Email submissions will...

1 answer below »
This is a C++ assignment that is due tomorrow at 11 pm. The description is in the uploaded file


COEN 244 (Summer 2022) - Assignment 3 Group Assignment (1 or 2 members) Submission The submission must be through Moodle on the submission link for Programming Assignment 1. Email submissions will NOT be accepted. The assignment must be done individually. All cases of plagiarism will be reported to authorities as per Concordia’s plagiarism policy. Create [SID_1]_[SID_2]_A3.zip (.gz, .tar, .zip are acceptable. .rar file is NOT acceptable) file contains a folder named with your student ID. This folder contains all the source code only for the assignment. Submissions do not follow the format may not be graded. Problem statement This assignment aims to practice operator overloading. The operator overloading techniques are applied to graph operations. The graph has the same definition as Assignment 2 as presented as follows: A Graph is formally defined as G=(N,E), consisting of the set V of vertices (or nodes) and the set E of edges, which are ordered pairs of the starting vertex and the ending vertex. Each vertex has ID and value as its basic attributes. Each edge has weight, starting vertex and ending vertex. A Graph can be a directed graph and undirected graph. A Directed Acyclic Graph (DAG) is a finite directed graph with directed cycles. This means from any vertex v, there is no way to follow a sequence of edge that eventually loops back to v again. An undirected graph (UG) is a graph where the edges are bidirectional. Please define either the class DAG or the class UG as derived class from the class Graph. In this assignment, the tasks are operator overloading. Suppose g1, g2, and g3 are objects of the graph class as you define, the illustrating examples and semantic meaning of each operator are presented as shown in the table below. Definition Example 1. operator == returns true if g1 and g2 have exactly the same vertices and edges if(g1 == g2){ … } 1. operator = assigns g2 to g1. g1 = g2; 2. operator++ in both prefix and postfix increase the weights of all edges by one. g1++; ++g1; 3. operator+ returns a graph that contains all the nodes of g1 and g2, and all the edges of g1 and g2. g3 = g1+ g2; 4. operator[ ] returns the vertex at the index position or update the value at the index position. (hint: make sure that the Vertex class should overload the assignment operator= ) Vertex v1 = g1[0]; Vertex v2; g1[2] = v2; 5. operator< outputs="" a="" graph="" with="" all="" the="" edges="" at="" the="" format="" that="" you="" can="" define.="" cout=""><>
Answered 1 days AfterAug 06, 2022

Answer To: COEN 244 (Summer XXXXXXXXXXAssignment 3 Group Assignment (1 or 2 members) Submission The submission...

Ruchi answered on Aug 08 2022
88 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here