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

  Modify the circuit of figure by rewriting the pld program

Modify the circuit of Figure by rewriting the PLD program to address memory in locations A0000H-BFFFFH for the ROM

  In the familiar base 10 system

In the familiar base 10 system, the smallest (rightmost) digit of a number is the ones place (100).  The next digit is in the tens place (101), and the next one is in the hundreds place (102) and so forth.  Thus the number 122 is really (1 * 102) + (..

  What will be the output of the program code

What will be the output of the program code?

  Create class integerset

Create class IntegerSet for which each object can hold integers in the range 0 through 100. Represent the set internally as a vector of bool values. Element a[i] is true if integer i is in the set. Element a[j] is false if integer j is not in the set..

  Create a program for a company named retail-mart

Prompt the user to enter an item name (one word only), a quantity and a price. For this step, in addition to functionality, I'll be looking at: location of the variable declarations; appropriateness of data types selected; appropriateness of the va..

  Think about logic and design first write the pseudo-code for

Think about logic and design first, write the pseudo-code for it. Draw a flowchart. Write the program in any of the language given below: Draw an IPO chart for your test cases.

  How do the properties derived classes differ

How do the properties derived classes differ

  Make header for the entire program

C code that I would like you to document it and make header for the entire program and for each function as well as make short comment inside the code. pay attention to the marking scheme Code Commenting:

  Questions related to c programming

Which statement will read a floating point value from the keyboard and store it in the variable x? A. printf("float = %f", x); B. scanf("%f", &x); C. scanf("&f", %x); D. scanf("%d", &x);

  Write a program to illustrate how to use your class

Declare an array of 10 components of type bankAccount to process up to 10 customers and write a program to illustrate how to use your class.

  Create the roman.h and implement roman class in roman.cpp

Create the roman.h and implement the Roman class in roman.cpp. Make sure that you put in measures to prevent multiple inclusion of the header file. Test your implementation using task2a.cpp.

  Write the program with indentation and formatting style

Write the program with indentation and formatting style as discussed in class, and given in the program requirement. Write documentation for your programs as discussed in class and given in the program requirement.

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