Solved

Help Prop Logic and GUI creation

Posted on 2003-11-18
5
280 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.
Suggested Courses

626 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