Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help Prop Logic and GUI creation

Posted on 2003-11-18
5
Medium Priority
?
283 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
  • 2
3 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 500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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 had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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

876 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