Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Discrete Structures 1 You should submit a single source code file named main.cpp that contains all of the C++ code required to complete this assignment.

Discrete Structures 1

You should submit a single source code file named main.cpp that contains all of the C++ code required to complete this assignment. Do not submit any executable files, any Visual Studio project files, or any data files. Your dropbox should contain nothing except the main.cpp file.

Given the argument:

Premise: (((P v Q) ^ (Q -> R)) XOR (P ^ R)) <-> (R ^ Q) Conclusion: (P v R)

In this example the premise is one single statement, albeit a long, complicated one.

Create a C++ program that generates the truth table for this argument, and indicates if the argument is valid or invalid. If the argument is invalid, identify the row(s) in the truth table that prove the argument is not valid.

Your program must be modularized so that a different argument can be assessed when your program is graded. The grade argument will have the same number of statements and variables as the argument above, but will be a different argument. In order to modularize your program to accept a different argument when graded, write one function to evaluate the premise and another function to evaluate the conclusion. You can use the boolean operators in C++ to do the AND, OR, etc but you will need to write a function for the IF, THEN (->) and IF AND ONLY IF (<->) parts of the premise. You do not need to read in the premise or the conclusion. You can hard code it into your program. When I test the program I will edit the code. Your program must have comments to tell me which lines to edit to change the premise and which lines to edit to change the conclusion. It will be helpful if you can code the premise into a single line of code.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago