Define a class to represent logical matrix

Assignment Help C/C++ Programming
Reference no: EM131305107

Object-Oriented Programming Assignment

Introduction - 

"A logical matrix or (0, 1) matrix is a matrix with entries from the Boolean domain B = {0, 1}. Such a matrix can be used to represent a binary relation between a pair of finite sets. If R is a binary relation between the finite indexed sets X and Y (so R ⊆ X×Y), then R can be represented by the logical matrix M whose row and column indices index the elements of X and Y, respectively, such that the entries of M are defined by:

2090_Figure.png

In order to designate the row and column numbers of the matrix, the sets X and Y are indexed with positive integers: i ranges from 1 to the cardinality (size) of X and j ranges from 1 to the cardinality of Y.

Define a class (called LogMat) to represent logical matrix of any binary relation as explained previously. 

A. The class has three member variables: matrix (as dynamic 2-D array), rowSize and columnSize.

B. Provide a default constructor with default parameter to initialize an empty matrix to 0 with a maximum of 10 X 10.

C. Overload the stream extraction (>>) to read the R from input file where the format of the input file as {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)} for each R.

D. Overload the stream insertion (<<) to display the matrix on the screen.

E. Overload the (==) operator to check if two sets are equal.

F. Overload the plus (+) operator to return the combination between two sets. For example if A and B are sets then A + B should return a set that contains all the elements in either or both of the sets.

G. Provide functions that should/must be in the class.

H. Write main program that:

i. Create an input file for each of the below relations:

  • aRb holds if and only if a divides b evenly, with no remainder
  • aRb holds if and only if the sum of a+b is an even number.

ii. Each set should be in format as mentioned in part C.

iii. Create at least one object for each relation.

iv. Test the operators the overloaded operators.

Reference no: EM131305107

Questions Cloud

Write a program that simulates multiple games of blackjack : Blackjack (twenty-one) is a casino game played with cards. The goal of the game is to draw cards that total as close to 21 points as possible without going over. All face cards count as 10 points, aces count as 1 or 11, and all other cards count t..
Call option on the stock that has a strike price : The current price of a stock is $22. In 1 year, the price will be either $28 or $15. The annual risk-free rate is 6%. Find the price of a call option on the stock that has a strike price is of $25 and that expires in 1 year.
Determines if the value is prime : Write a program that gets a starting value from the user and then prints the Syracuse sequence for that starting value.
Black-scholes option pricing model-what is options value : Black-Scholes Model Assume that you have been given the following information on Purcell Industries: Current stock price = $15 Strike price of option = $14 Time to maturity of option = 6 months Risk-free rate = 8% Variance of stock return = 0.11 d1 =..
Define a class to represent logical matrix : COMP3200: Object-Oriented Programming Assignment. Define a class (called LogMat) to represent logical matrix of any binary relation as explained previously. The class has three member variables: matrix (as dynamic 2-D array), rowSize and columnSize
Find the price of a call option on the stock : The current price of a stock is $15. In 6 months, the price will be either $18 or $11. The annual risk-free rate is 7%. Find the price of a call option on the stock that has a strike price of $12 and that expires in 6 months.
What is the exercise value of call option-option time value : A call option on the stock of Bedrock Boulders has a market price of $7. The stock sells for $29 a share, and the option has a strike price of $26 a share. What is the exercise value of the call option? What is the option's time value?
Find a basis for the orthogonal complement : find a basis for the orthogonal complement to the row space; choose a convenient vector in both of these spaces and verify/demonstrate the orthogonality.
Discuss two different roles that project managers can play : Discuss at least two different roles that project managers can play in organizational leadership. Describe at least three human resource factors that affect project management.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  C programming applications

The current-voltage characteristic or I-V curve is a relationship, typically represented as a chart or graph, between the electric current through a circuit, device, or material, and the corresponding voltage,  or  potential  difference  across  i..

  Write programs to play a card game

You will write two programs to play a card game ("clubs"). A separate document describing the rules of "clubs" will be provided.The first program (clubber) will listen on its stdin for information about the game and give its moves to stdout.

  How to spot if a character is a lower case letter or not

You must be finding out how to convert a letter to upper case. I am having difficulty with this program because I do not know where to start with.

  How many times will jump be displayed

Write an if statement that assigns 15 to x when y is greater than or equal to or 7 and how many times will "jump" be displayed in the following program segment? If the loop doesn't terminate, write "infinite".

  Create a c++ project using appropriate data types

Create a C++ project. Declare the following identifiers using appropriate data types.

  Write a program which initialize an integer array

Write a program which performs the tasks - return the control to main( )and print the new array elements in main.

  C string and two int reference parameters

Write a complete function, not an entire program, that has a C string and two int reference parameters (call them a and b), returning nothing.

  Prepare a main function

Write a function that converts an input of some integer number of nickels into outputs of integer numbers of dollars, quarters, and nickels.

  Describe the three ways a client

Describe the three ways a client can reference a name from a namespace in C++ and what are the arguments for and against the C++ policy on inlining of methods?

  Write the definitions of the functions

Write the definition of the function setZero that initializes any one-dimensional array of type int to 0.

  Write a java program

Write a JAVA program that will input Employee Name, Rate per hour, No. of hours worked and will compute the daily wage of an employee. If the number of hours worked exceeds eight hours add 30% to each excess hours as overtime rate.

  Integerset class create class integerset for which each

integerset class create class integerset for which each object can hold integers in the range 0 through 100. represent

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd