Identifying properties of relations Write a program that will determine if a relation satisfies the following...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Identifying properties of relations Write a program that will determine if a relation satisfies the following properties: ⚫ Reflexive • Antireflexive Symmetric • Antisymmetric Input Your program should take as input the 0-1 matrix representation of a relation. Assume that the relation is on a set of 10 elements. So, your program should read a 10*10 boolean matiix from a file. Code Your program should determine if the input relation satisfies any or all of the above properties. It should accept a *.txt file as input. It should check individually for the existence or violation of each property. Your program should adhere to the following programming guidelines: • Use proper naming conventions, such as upper case for constants, lower case for variables, and title case for classes. • Use proper formatting, such as tabs, spaces, line breaks, and curly braces. • Display good documentation, such as, a header block for each file and and inline comments, as needed. • Display good design, such as, decomposition of tasks and modular code. • Should be no more complex than necessary, for example, if a task can be accomplished by a single loop, it should not be programmed with a 3-way nested loop. • Satisfy all the requirements specified in this document. Output Your program should output statements that claim the existence or violation of each property. A sample program output is given below. File input: matrix5.txt Reflexive - yes Antireflexive - no Symmetric-yes Antisymmetric - yes Deliverables Submit your program and its results for the three test cases given below. You may output the results to a file and submit it. The following should be included in your zipped folder submission: • Source code • Output for the three test cases • Additional test cases and their respective outputs Test cases Matrix1.txt 0000000000 1100000000 1010000000 1001000000 1000 100000 1000010000 1000000000 1000000100 10000 10000 1000000001 Matrix2.txt 100 1101011 0101000100 0010100100 1101000101 1010100100 0000010110 1000001101 0111111100 1000010010 1001001001 Matrix3.txt 0111101011 0011001100 0000100100 1100000101 1010001100 0001000110 1110110101 0111111001 1000010001 100 100 1000 Identifying properties of relations Write a program that will determine if a relation satisfies the following properties: ⚫ Reflexive • Antireflexive Symmetric • Antisymmetric Input Your program should take as input the 0-1 matrix representation of a relation. Assume that the relation is on a set of 10 elements. So, your program should read a 10*10 boolean matiix from a file. Code Your program should determine if the input relation satisfies any or all of the above properties. It should accept a *.txt file as input. It should check individually for the existence or violation of each property. Your program should adhere to the following programming guidelines: • Use proper naming conventions, such as upper case for constants, lower case for variables, and title case for classes. • Use proper formatting, such as tabs, spaces, line breaks, and curly braces. • Display good documentation, such as, a header block for each file and and inline comments, as needed. • Display good design, such as, decomposition of tasks and modular code. • Should be no more complex than necessary, for example, if a task can be accomplished by a single loop, it should not be programmed with a 3-way nested loop. • Satisfy all the requirements specified in this document. Output Your program should output statements that claim the existence or violation of each property. A sample program output is given below. File input: matrix5.txt Reflexive - yes Antireflexive - no Symmetric-yes Antisymmetric - yes Deliverables Submit your program and its results for the three test cases given below. You may output the results to a file and submit it. The following should be included in your zipped folder submission: • Source code • Output for the three test cases • Additional test cases and their respective outputs Test cases Matrix1.txt 0000000000 1100000000 1010000000 1001000000 1000 100000 1000010000 1000000000 1000000100 10000 10000 1000000001 Matrix2.txt 100 1101011 0101000100 0010100100 1101000101 1010100100 0000010110 1000001101 0111111100 1000010010 1001001001 Matrix3.txt 0111101011 0011001100 0000100100 1100000101 1010001100 0001000110 1110110101 0111111001 1000010001 100 100 1000
Expert Answer:
Answer rating: 100% (QA)
Java code for above problem import javautil import javaio class Main static variables that stores length of matrix public static int NUM10 testing mai... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
The organizing committee for the HCC Celebrates Columbia's 50th Birthday, Inc., has planned a special event commemorating notable people originally from Columbia, MD. The committee has invited the...
-
As our energy structure transitions toward renewable fuels, forest-based biomass fuels benefit from this transition. What are the likely effects of this transition on consumers, producers, and the...
-
On March 1, 2016, Babar Inc., pays $1,200,000 for a store building, moves into the building and begins business on April 1. Babar properly allocates $1,000,000 of its cost to the building and...
-
The condensed financial statements of Eau Frache Company for the years 2009 and 2010 are presented below. Compute the following ratios for 2010 and 2009. (a) Current ratio. (b) Inventory turnover....
-
Prepare the income statement for West Nautical Company in E2-31A for the most recent year. Assume that the company sold 34,000 units of its product at a price of $12 each during the year. Data From...
-
Using the direct method, prepare the statement of cash flows for the year ended June 30,2011. GECKO INC. Comparative Balance Sheets June 30,2011 and 2010 2011 2010 GECKO INC. Income Statement For...
-
Write a program to check whether the given input is digit or lowercase character or upper case character or a special character (use 'if-else-if' ladder)
-
The manager of a local shop has collected information about the number of customers visiting the shop. Data from the last seven week periods is shown below: Week visitors 1 10 2 12 3 15 19 5 16 6 18...
-
Your friend approached you and offered you an investment that is expected to produce $300,000 in 60 months. If you want to earn 5% per annum, compounded monthly, how much should you offer to pay for...
-
A1 mx 1 m (square) vertical pier supports a bridge over an Alaskan river. Determine the force (loading) on the pier by a 10 m x 10 m ice floe that is 1 m thick, and carried by the river. Assume an...
-
Did the USD appreciate/depreciate relative to these currencies during the crisis 2008-2009? What could be a reason for this? What was the most recent US dollar dynamics versus these currencies?
-
A power source for a portable electrical defibrillator contains a capacitor of capacitance 54 F. The potential difference across the plates of the capacitor is raised to 4.010^3 V and a fraction of...
-
Sometimes there are no rules that directly cover a situation. What should the IA rely on to make the appropriate decision?
-
In 2014, Daryl bought a life insurance policy on his life with a death benefit of $1,200,000. He named his wife Melanie the beneficiary of this policy. In 2017, Daryl created an ILIT with Melanie as...
-
Figure displays a 12.0 V battery 3 four uncharged capacitors of capacitances C1 = 4.00F, C2 = 6.00F, and C3 = 3.00F. The switch is thrown to the left side until capacitor 1 is fully charged. Then the...
-
Write a program that creates two instances of the generic class LinkedList given in Listing 12.12. The first instance is stadiumNames and will hold items of type String. The second instance is...
-
Suppose that we want to store digitized audio information in a binary file. An audio signal typically does not change much from one sample to the next. In this case, less memory is used if we record...
-
Create a JavaFX application that displays something like the following picture. You should have methods for drawing a monkey face and a hand. Hear no evil See no evil Speak no evil
-
W hat is diauxic growth? Explain the roles of cAMP and CAP in this process.
-
What is antisense RNA? How does it affect the translation of a complementary mRNA?
-
List and describe three general ways that the functions of transcription factors can be modulated.
Study smarter with the SolutionInn App