A program to show the truth table for a simple wff

Assignment Help Computer Engineering
Reference no: EM132208385

Question :

Write a program in C++ that will output the truth table for a simple wff. There will only be Ps and Qs, so you can hard code the P truth table and the Q truth table into arrays.

The user will use A for ^ , O for V, N for ' , & I for -> .

Hint: Read the first character, load the appropriate truth table into the first working array. Read the next character. If it is an N, output the negation of the first working array.

If it is a P or Q, oad the appropriate truth table into the second working, array, then read the last character and output the appropriate truth table.

Expression Would be input as

P^Q PQA

P' PN

Q->P QPI

Example runs (note the user input is bold)

Run 1

Please input the wff: PQA

The truth table is

T

F

F

F

Run 2

Please input the wff: P'

The truth table is

F

F

T

T

Reference no: EM132208385

Questions Cloud

Create a separate class for the jobs : Create a separate Class for the jobs. Each job has a ID, Arrival time, Burst Time, and Priority.
Write a program to play the memory game : Children often play a memory game in which a deck of cards containing matching pairs is used. The cards are shuffled and placed face down on a table.
Define a structure that contains a character member : Define and integer variable named EmployeesCount and initialize it to 3 employees .
Describe the supply chain components : Study supply chain structure of any humanitarian organization in the United Arab Emirates or in any other country worldwide. Identify its main supply chain.
A program to show the truth table for a simple wff : Write a program in C++ that will output the truth table for a simple wff. There will only be Ps and Qs, so you can hard code the P truth table
Determine how you derived your solutions : Suppose a 6-year timeframe where the interest rate for the first 2 years is 10%, the interest rate for the next 2 years is 12% and the interest rate.
How many values in the array are not a multiple of 2 : The program should print the number of odd values in the array, that is how many values in the array are not a multiple of 2.
When is the final for the given class : Explain what effect a reduction in productivity has on wage setting behavior, P setting behavior, the equilibrium real wage, the natural rate of unemployment.
Create a menu driven application that uses information : Create a menu driven application that uses information in files to keep track of your stock portfolio.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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