Solved

Help Prop Logic and GUI creation

Posted on 2003-11-18
5
279 Views
Last Modified: 2006-11-17
I need to create an application with a GUI that will allow me to enter a term of Propositional Logic and view the truth table for that term.  Once the term is entered, you can either request the term to be displayed with brackets where necessary, or request the truth table for that term to be shown. The application should give an error-message if the term that has been entered is not well-formed; if the term is well-formed, then the application should present either the term with brackets only where necessary, or the truth table for that term, depending on the request made.

For example, if the user enters the term:


    (a or c) implies a and b


and requests the truth table to be shown, then your application should present (something like):

    a c b | a or c implies a and b
    ----------------------------
    T T T |            T
    F T T |            F
    T F T |            T
    F F T |            T
    T T F |            F
    F T F |            F
    T F F |            F
    F F F |            T


The GUI that should implement the Model-View-Controller.
0
Comment
Question by:withtheskills
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 15

Expert Comment

by:jimmack
ID: 9770172
We can't do your homework for you.  When you've made a start and you have problems, come back and ask specific questions.
0
 

Author Comment

by:withtheskills
ID: 9777357
Sorry I just need some advice on where to start
0
 
LVL 15

Accepted Solution

by:
jimmack earned 125 total points
ID: 9777384
How much do you need?  It's difficult to assess whether you have a good understanding of Java (and Swing) or not.  Since you mention MVC, this implies that you're looking for a GUI solution.

Start with a JOptionPane.showInputDialog() to get the input from the user.  There are several different versions of this method, so you'll need to decide which one to use depending on how much information you want to supply to it.

For the display of the truth table, I would probably use something like a GridLayout inside a JPanel, added to the center of a JFrame.  The GridLayout having the appropriate number of rows and columns for the table you are going to display.  If the table could be very long, add the JPanel to a JScrollPane.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jboss wildfly 10.1 10 619
mysql jsp example issue 32 96
Java array 21 150
Retrieve multiple results between delimiters in a String in Java 13 25
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question