Java Calculator, Minus & multiplication button gets wrong answer?

import java.awt.event.*;
import java.applet.Applet;
import javax.swing.*;
import java.awt.*;
public class calc extends JApplet implements ActionListener
     JTextField input = new JTextField("");
     JButton numbers[] = new JButton[10];
     JButton add = new JButton("+");
     JButton equals = new JButton("=");
     JButton minus = new JButton("-");
    JButton multiply = new JButton("*");
    JButton divide = new JButton("/");
    JButton clear = new JButton("AC");
     int num1 = 0;
     int num2 = 0;     
     String oper = " ";
     public void init()
          setLayout(null);
          setBackground(new Color(227,131,125));          
          Design();
     public void Design()
          int x = 1;
          int y= 1;
          int wi = 10;
          int he = 50;
          input.setSize(250,30);
          input.setLocation(10,10);
          add(input);
          add.setSize(80,30);
          add.setLocation(280,50);
          add.addActionListener(this);
          add(add);
          minus.setSize(80,30);
          minus.setLocation(280,90);
          minus.addActionListener(this);
          add(minus);
          multiply.setSize(80,30);
          multiply.setLocation(280,130);
          multiply.addActionListener(this);
          add(multiply);
          divide.setSize(80,30);
          divide.setLocation(280,175);
          divide.addActionListener(this);
          add(divide);
          equals.setSize(80,30);
          equals.setLocation(190,175);
          equals.addActionListener(this);
          add(equals);
         clear.setSize(80,30);
          clear.setLocation(100,175);
          clear.addActionListener(this);
          add(clear);
          while(x<=10)
               if (x==10)
               numbers[x-1] = new JButton("0");
               numbers[x-1].setSize(80,30);
               numbers[x-1].setLocation(wi,he);
               //numbers[x-1].setBackground();
               else
               numbers[x-1] = new JButton(Integer.toString(x));
               numbers[x-1].setSize(80,30);
               numbers[x-1].setLocation(wi,he);
               wi = wi + 90;
                    if(x%3==0)
                         he = he + 40;
                         wi = 10;
               numbers[x-1].addActionListener(this);
               add(numbers[x-1]);          
               x++;
     public void actionPerformed(ActionEvent act)
          int x = 0;
          while(x<10)
               if(act.getSource().equals(numbers[x]))
                    if(x==9)
                         input.setText("0");
                    else                    
                    input.setText(Integer.toString(x+1));
               x++;
          if (act.getSource().equals(add))
               num1 = Integer.parseInt(input.getText());
          else if(act.getSource().equals(equals))
               num2 = Integer.parseInt(input.getText());
               input.setText(Integer.toString(num1 + num2));
               if (act.getSource().equals(minus))
               num1 = Integer.parseInt(input.getText());
               oper = "minus";
          else if(act.getSource().equals(equals))
               num2 = Integer.parseInt(input.getText());
               if(oper.equals("minus"))
                    input.setText(Integer.toString(num1 - num2));
               if (act.getSource().equals(multiply))
               num1 = Integer.parseInt(input.getText());
               oper = "multiply";
          else if(act.getSource().equals(equals))
               num2 = Integer.parseInt(input.getText());
               if(oper.equals("multiply"))
                    input.setText(Integer.toString(num1 * num2));
The addition button is working, but i cant seem to make minus and multiply button work, they get wrong answer when i use them.. what could bee the problem with my code

Sorry, but I don't see a simple fix in this code here (Hopefully I'm wrong and someone else will see this, but I don't) Because of this, I recommend that you fully scrap this code and start over from square one. I don't think that you really "see" your logic here. To help you see what you are trying to do, you need to separate your logic from your GUI. Try to build a non-gui calculator that works via simple console menu. Once you get this working, then use this code to create a GUI calculator.

Similar Messages

  • Getting wrong answers for conversion

    Hi all,
    I've been working on a program for base conversion.
    After making some adjustments I am yet to get the "correct" answer for my conversion. For example when i key in 100 i get 10 as my answer.
    I am using a label to set the text of my answer but all it does is take the number entered in the textfield i guess. Appreciate all replies.
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.io.*;
    This is an applet that enables the user to enter the number and the base
    system of number entered. Upon clicking the Convert button, the program should
    display the number, the positional weightage of each digit of the number, and
    the decimal equivalent of the number
    public class Testing1 extends Applet implements ActionListener {
         //declare all components
         Label numbersystemLabel;  //Top Label
         Label numberLabel;  //Middle Label next to the number TextField
         Label baseLabel;  //Middle Label next to the base TextField
         Label answerLabel; //Bottom Label for the answer
         static String numberkeyin;  //number that is entered in the textfield
            static String bintype="binary";  //convert binary base to decimal
         static String octtype="octal";  //convert octal base to decimal
         static String yrtype="";
         static String real= "";
         TextField numberField;
         TextField baseField;
         Button convert;
         int Answer;
         Panel p1;
         Panel p2;
         Panel p3;
        public void init() {
             p1 = new Panel ();
             p2 = new Panel ();
             p3 = new Panel ();
             p1.setLayout(new BorderLayout(25,25));
             p2.setLayout(new GridLayout(2,2,2,2));
             p3.setLayout(new BorderLayout(25,25));
             numbersystemLabel=new Label ("Number System");
              p1.add("North",numbersystemLabel);
             numberLabel=new Label ("Enter the number : ");
               p2.add(numberLabel);
               numberField=new TextField(9);
               p2.add(numberField);
               baseLabel=new Label ("Enter the base system  ");
               p2.add(baseLabel);
               baseField=new TextField(9);
               p2.add(baseField);
               convert=new Button ("Convert");
               convert.addActionListener(this);
               answerLabel=new Label ("Decimal Equivalent : ");
              p1.add("South",answerLabel);
              p3.add("North",p2);
              p3.add("South",convert);
              p1.add("Center",p3);
              add(p3);
              add(p1);
      public void actionPerformed(ActionEvent event) {
         Answer=Integer.parseInt(numberField.getText());
         yrtype=baseField.getText();
         answerLabel.setText(real);
         if (yrtype.equals(bintype)){
           real="Decimal Equivalent: " +Answer  ;
        else {
           real="Decimal Equivalent: Daddy's girl ";
         repaint();
       private void Compute()  {
         int i;
         int countlength;
         char bit;
        Answer = 0; // initialize the answer to zero.
        countlength = numberkeyin.length();   
            // find the length of the binary number string.
            for( i=1; i<=countlength; i++) {
                   bit = numberkeyin.charAt(countlength-i);
                    // extract each binary digit, starting from the right.
                   if( bit == '1' ) {
                        Answer += Math.pow(2.0,i-1.0);
       // The digit was a "1", so add it's decimal equivalent to the answer.
        public void paint(Graphics g)  {
         //power
         String a= "2" ; String v= "4";
         String b= "2" ; String w= "3";
         String c= "2" ; String x= "2";
            String d= "2" ; String y= "1";
            String e= "2" ; String z= "0";
           g.setFont(new Font ("Helvetica",Font.ITALIC+Font.BOLD,20));
           g.drawString("" +e +"     " +d +"     " +c +"     " +b +"     " +a, 350, 250 );
           g.setFont(new Font ("Helvetica",Font.ITALIC+Font.BOLD,12));
           g.drawString(" " +v +"           " +w +"            " +x +"            " +y +"            " +z, 355, 235 );
     

    I think you need to completely re-think your
    actionPerformed method. I don't think there's
    anything correct in there.
    I'm not going to do you homework for you.
    Jeez, what's wrong with the people in here. I am not
    asking anyone to do my homework for God's sake. Yeah
    sure its a school assignment (what's the big deal
    about that?)I just want to know the errors pertaining
    to my code and ways on improving/correcting it.
    Oh yeah,,, just knowing won't help. I have checked my
    action Performed and i don't see anything wrong in
    there though.
    I am a newbie in java and would like to learn. So my
    question is how can i call the compute method?
    God save me from paranoids.Hi miss_mushroom...
    If you look through these forums, you will find many "do my homework requests"...
    so the replies here are understandable...
    anyway here is an example code snippet...
    public void sayHello(){
       System.out.println("Hello);//outputs "Hello"
    public int doSomeMath(int num1,int num2){
    /* returns an int and takes two ints as arguements\parameters */
       return num1 + num2; this is where the int get returned...
    public void callMethods(){ // yet another method
       sayHello();// calls sayHello which displays "Hello"
       int answer = doSomeMath(10,5);//calls do someMath which adds 10 and 5
       // and the returned value is assigned to answer...
    }many of your question can be answered by reading Sun's Java Tutorial...
    http://java.sun.com/docs/books/tutorial/index.html
    including your bits.length question...
    - MaxxDmg...
    - ' He who never sleeps... '

  • Why java gives wrong answer

    float f=40.3f;
    System.out.println(f%4);
    The answer for above must be 0.3 but java gives 0.29999924
    WHY????
    (This answer is ok for small calculations but it may give wrong answers for large calculations)

    float f=40.3f;
    System.out.println(f%4);
    The answer for above must be 0.3 but java gives
    0.29999924
    WHY????
    (This answer is ok for small calculations but it may
    give wrong answers for large calculations)Use BigDecimal with MathContext or roll your own Fraction class- this way any repeating decimal is represented exactly.
    Message was edited by:
    snic.snac

  • Changing Font Of Multiple Buttons

    Hey ya'll! First off i'm new here and it looks like you guys
    know what you're talking about. i searched the forums but could not
    find any help (perhaps i wasn't' looking hard enough) ANYWAY here
    is the deal:
    i'm a complete n00b.
    I have a flash movie with multiple buttons and want to change
    the fonts of ALL buttons simultaneously (it changes color on
    mouseover, so i want to change the font of the text which is a
    different color... ... the fla file is here.... i can make any
    changes necessary and start over if need be (its a pretty simple
    flash menu i guess) any help with optimization and efficiency would
    be appreciated.
    thanks in advance
    http://gmoonit.com/matt/flashmenu.swf
    http://gmoonit.com/matt/flashmenu.fla
    http://gmoonit.com/matt/flashmenu.html
    you can send files to [email protected]
    aim: gmoonit
    msn: [email protected]
    yahoo: [email protected]
    meebo: gmoonit

    gmoonit wrote:
    > Hey ya'll! First off i'm new here and it looks like you
    guys know what you're
    > talking about. i searched the forums but could not find
    any help (perhaps i
    > wasn't' looking hard enough) ANYWAY here is the deal:
    > i'm a complete n00b.
    > I have a flash movie with multiple buttons and want to
    change the fonts of ALL
    > buttons simultaneously (it changes color on mouseover,
    so i want to change the
    > font of the text which is a different color... ... the
    fla file is here.... i
    > can make any changes necessary and start over if need be
    (its a pretty simple
    > flash menu i guess) any help with optimization and
    efficiency would be
    > appreciated.
    You need to edit each button individually, one by one.
    The only time when multiple buttons get changed all at once
    is when you
    design it fully dynamic. One button/movie clip, duplicated,
    multiplied and
    control by action script.
    In your case, you need to change one by one manually.
    By the way, take note that the forum is connected to News
    Server. Many of us
    never use the browser based forum so by bumping your post,
    you only make it appear
    answered and your chances of getting help get smaller as we
    usually go for the
    unanswered threads only.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • I've logged onto iTunes, but it's asking me security questions because it's a new device, and I'm getting the answers wrong, but iTunes wants to reset but send the new passwords to my ex partners email address how can I get round this.

    I've logged onto iTunes, but it's asking me security questions because it's a new device, and I'm getting the answers wrong, but iTunes wants to reset but send the new passwords to my ex partners email address how can I get round this.

    I believe part of the recovery process is you get an e-mail allowing you to reset questions.  If that e-mail isn't correct either because your son set it up then you really have no option but to ask Apple again.  They are getting strict abotu security and given the number of "My iTunes account got hacked" posts here I can guess why.  They have no way of knowing you really are the owner of the account.  It's like me going to a policeman and saying, "See that car over there?  That is mine, can you open the door for me?" and the police opening it on that basis alone.
    Frequently asked questions about Apple ID - http://support.apple.com/kb/HE37 --> Can I change the answers to the security questions for my Apple ID?  --> Yes. You can change the answers to the security questions provided when you originally signed up for your Apple ID. Go to My Apple ID (http://appleid.apple.com/) and click Manage your account.
    Forgotten security questions - https://discussions.apple.com/message/18402551  and https://discussions.apple.com/message/18625296
    More involved forgotten question issues - https://discussions.apple.com/thread/3961813
    Kappy 09/2012 post about security questions - https://discussions.apple.com/message/19569468
    John Galt's tips (09&11/2012) - https://discussions.apple.com/message/19809294 and https://discussions.apple.com/message/20229239
    If none of the above work, contact iTunes Support at http://www.apple.com/support/itunes/contact/ and follow the instructions to report the issue to the iTunes Store.

  • Odd Calculator Issue - Wrong Answer??

    A friend of mine was working on something yesterday afternoon and used his original iphone calculator to check 197/14.......the calc returned 1. I tried the same on my 3g and it returned a 1 for me too. In fact we both tried several times during the afternoon with the same result.
    Today I checked again and it returned the correct answer..........14.0714286.
    Seems odd to have intermittent "wrong" answers and definitely makes me wary of trusting calculator for anything. Any ideas?

    Computers are usually deterministic, so the most likely reason is that you both made an entry error yesterday.

  • Calculator gives wrong answer

    Imac 2,7 GHz Core i5. Mavericks updated. Calculator 10.8. I enter 10+10/2 and get 15. I enter 10+10= and get 20. I then divide result by two and get correct answer-10. But. Calculator broke the result (20) into 10+10 then divided by 2. (See entry 3 in Paper Tape). Simple 20 divided by 2 computes the correct answer-10. See Screen Capture. Any thoughts.

    Check the link below.
    http://www.mathgoodies.com/lessons/vol7/order_operations.html

  • Multiple Buttons in JTable Headers:  Listening for Mouse Clicks

    I am writing a table which has table headers that contain multiple buttons. For the header cells, I am using a custom cell renderer which extends JPanel. A JLabel and JButtons are added to the JPanel.
    Unfortunately, the buttons do not do anything. (Clicking in the area of a button doesn't appear to have any effect; the button doesn't appear to be pressed.)
    Looking through the archives, I read a suggestion that the way to solve this problem is to listen for mouse clicks on the table header and then determine whether the mouse clicks fall in the area of the button. However, I cannot seem to get coordinates for the button that match the coordinates I see for mouse clicks.
    The coordinates for mouse clicks seem to be relative to the top left corner of the table header (which would match the specification for mouse listeners). I haven't figured out how to get corresponding coordinates for the button. The coordinates returned by JButton.getBounds() seem to be relative to the top left corner of the panel. I hoped I could just add those to the coordinates for the panel to get coordinates relative to the table header, but JPanel.getBounds() gives me negative numbers for x and y (?!?). JPanel.getLocation() gives me the same negative numbers. When I tried JPanel.getLocationOnScreen(), I get an IllegalComponentStateException:
    Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
    Can someone tell me how to get coordinates for the button on the JTableHeader? Or is there an easier way to do this (some way to make the buttons actually work so I can just use an ActionListener like I normally would)?
    Here is relevant code:
    public class MyTableHeaderRenderer extends JPanel implements TableCellRenderer {
    public MyTableHeaderRenderer() {
      setOpaque(true);
      // ... set colors...
      setBorder(UIManager.getBorder("TableHeader.cellBorder"));
      setLayout(new FlowLayout(FlowLayout.LEADING));
      setAlignmentY(Component.CENTER_ALIGNMENT);
    public Component getTableCellRendererComponent(JTable table,
                                                     Object value,
                                                     boolean isSelected,
                                                     boolean hasFocus,
                                                     int row,
                                                     int column){
      if (table != null){
        removeAll();
        String valueString = (value == null) ? "" : value.toString();
        add(new JLabel(valueString));
        Insets zeroInsets = new Insets(0, 0, 0, 0);
        final JButton sortAscendingButton = new JButton("1");
        sortAscendingButton.setMargin(zeroInsets);
        table.getTableHeader().addMouseListener(new MouseAdapter(){
          public void mouseClicked(MouseEvent e) {
            Rectangle buttonBounds = sortAscendingButton.getBounds();
            Rectangle panelBounds = MyTableHeaderRenderer.this.getBounds();
            System.out.println(Revising based on (" + panelBounds.x + ", "
                               + panelBounds.y + ")...");
            buttonBounds.translate(panelBounds.x, panelBounds.y);
            if (buttonBounds.contains(e.getX(), e.getY())){  // The click was on this button.
              System.out.println("Calling sortAscending...");
              ((MyTableModel) table.getModel()).sortAscending(column);
            else{
              System.out.println("(" + e.getX() + ", " + e.getY() + ") is not within "
                                 + sortAscendingButton.getBounds() + " [ revised to " + buttonBounds + "].");
        sortAscendingButton.setEnabled(true);
        add(sortAscendingButton);
        JButton button2 = new JButton("2");
        button2.setMargin(zeroInsets);
        add(button2);
        //etc
      return this;
    }

    I found a solution to this: It's the getHeaderRect method in class JTableHeader.
    table.getTableHeader().addMouseListener(new MouseAdapter(){
      public void mouseClicked(MouseEvent e) {
        Rectangle panelBounds = table.getTableHeader().getHeaderRect(column);
        Rectangle buttonBounds = sortAscendingButton.getBounds();
        buttonBounds.translate(panelBounds.x, panelBounds.y);
        if (buttonBounds.contains(e.getX(), e.getY()) && processedEvents.add(e)){  // The click was on this button.
          ((MyTableModel) table.getModel()).sortAscending(column);
    });

  • Help Please Needed for Java Calculator - ActionListener HELP

    Hi. I am constructing a simple Java calculator and need help with the actionlistener and how it could work with my program. I am not too sure how to begin constructing the actionlistener. I would like to know the best and most simple solution to get this program work the way it should, like a real calculator. If anyone can help me, that would be much appreciated.
    package calculator;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class CalculatorGUI extends JFrame implements ActionListener{
    JTextField screen;
    JButton button7;
    JButton button8;
    JButton button9;
    JButton button4;
    JButton button5;
    JButton button6;
    JButton button1;
    JButton button2;
    JButton button3;
    JButton button0;
    JButton add;
    JButton minus;
    JButton multiply;
    JButton divide;
    JButton equals;
    JButton clear;
    private JTextField m_displayField;
    private boolean m_startNumber = true;
    private String m_previousOp = "=";
    private CalculatorLogic m_logic = new CalculatorLogic();
    public CalculatorGUI() {
    CalculatorGUILayout customLayout = new CalculatorGUILayout();
    getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
    getContentPane().setLayout(customLayout);
    screen = new JTextField("textfield_1");
    getContentPane().add(screen);
    button7 = new JButton("7");
    getContentPane().add(button7);
    button7.addActionListener(this);
    button8 = new JButton("8");
    getContentPane().add(button8);
    button8.addActionListener(this);
    button9 = new JButton("9");
    getContentPane().add(button9);
    button9.addActionListener(this);
    button4 = new JButton("4");
    getContentPane().add(button4);
    button4.addActionListener(this);
    button5 = new JButton("5");
    getContentPane().add(button5);
    button5.addActionListener(this);
    button6 = new JButton("6");
    getContentPane().add(button6);
    button6.addActionListener(this);
    button1 = new JButton("1");
    getContentPane().add(button1);
    button1.addActionListener(this);
    button2 = new JButton("2");
    getContentPane().add(button2);
    button2.addActionListener(this);
    button3 = new JButton("3");
    getContentPane().add(button3);
    button3.addActionListener(this);
    button0 = new JButton("0");
    getContentPane().add(button0);
    button0.addActionListener(this);
    add = new JButton("+");
    getContentPane().add(add);
    add.addActionListener(this);
    minus = new JButton("-");
    getContentPane().add(minus);
    minus.addActionListener(this);
    multiply = new JButton("*");
    getContentPane().add(multiply);
    multiply.addActionListener(this);
    divide = new JButton("/");
    getContentPane().add(divide);
    divide.addActionListener(this);
    equals = new JButton("=");
    getContentPane().add(equals);
    equals.addActionListener(this);
    clear = new JButton("Clear");
    getContentPane().add(clear);
    clear.addActionListener(this);
    setSize(getPreferredSize());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public void actionPerformed(ActionEvent event) {
    public static void main(String args[]) {
    CalculatorGUI window = new CalculatorGUI();
    window.setTitle("Calculator");
    window.pack();
    window.show();
    class CalculatorGUILayout implements LayoutManager {
    public CalculatorGUILayout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 421 + insets.left + insets.right;
    dim.height = 494 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+8,408,64);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+80,96,56);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+80,96,56);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+80,96,56);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+144,96,56);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+144,96,56);}
    c = parent.getComponent(6);
    if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+144,96,56);}
    c = parent.getComponent(7);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+208,96,56);}
    c = parent.getComponent(8);
    if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+208,96,56);}
    c = parent.getComponent(9);
    if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+208,96,56);}
    c = parent.getComponent(10);
    if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+272,96,56);}
    c = parent.getComponent(11);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+80,72,56);}
    c = parent.getComponent(12);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+144,72,56);}
    c = parent.getComponent(13);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+208,72,56);}
    c = parent.getComponent(14);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+272,72,56);}
    c = parent.getComponent(15);
    if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+336,72,56);}
    c = parent.getComponent(16);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+408,408,72);}
    }

    Yeah, I have a rough idea of what the calculator
    should do, like most people would. Its just that I
    dont know how to implement this in Java. Thats the
    problem. Can anyone provide me with code snippets
    that I can try?No I would rather see you make an effort from what has been discussed here. This is not a Java problem this is a general programming problem.

  • Able to advance past question with wrong answer

    The following applies to a multiple choice question in Captivate 3.0.1 Build 589. You are able to advance through a question even if you have selected the wrong answer by doing the following:
    Answer a question incorrectly. A box saying "Try Again" pops up.
    Press the previous button on the Captivate navigation bar to go to the previous slide.
    Press the next button on the Captivate navigation bar to advance to the question slide. The incorrect answer is still selected.
    Press the next button on the Captivate navigation bar while the incorrect answer is still selected.
    Captivate advances, even though you have not answered the question correctly.
    This is a major issue for me for two reasons. A) It allows learners to advance without demonstrating that they learned what we are trying to teach them, and B) It actually misinforms learners by letting them advance with the wrong answer selected, so they may actually believe that what they answered is correct.
    Does anyone else have this problem? Anyone have any ideas how I can fix it?
    Thanks very much for your help,
    Marc

    Marc,
    Do you know what wrong answer options you have selected? If you do not want the user to advance when they select a wrong answer, you can make sure they do not. On the question slides of interest, go to Edit Question. Select Options. Under "If wrong answer" section, select Infinite attempts. Now the user will not be able to advance until he/she gets the answer correct. The only side note on this is the user will get the Incorrect Answer message only one time. After that there are no response message until the correct answer is chosen. Hope this helps.
    Darin

  • Why do i get "wrong password" when i try to log on to the wifi on my ipad 3?

    I have 2 laptops, 2 ipones (5 and 4s, running on ver 6.1.4), an ipad mini and an ipad 3 in my home.
    I'm using my wifi successfuly with every device except for my ipad 3.
    on the "wireless" tab, i can see the network, i'm trying to type the password but i keep on getting "wrong password".
    The ipad can use wifi in other places with passwords.
    I checked how im writing and tried to type again on other devices, that's not the problem. Its not a problem with capitals or o-0 or something like that.
    I've tried reseting the network settings,  reseting my router, reseting my ipad (pressing "off button" + "home button"). I've tried changing password on my router, without succuess.
    that is really annoing, you're paying a lot for something that's suppose to work perfectly, and you get problems like that.
    I really need wifi on my ipad, and I've searched forums all over the internet for a solution. it turnes out that a lot of people are experiencing the same problem, whitout a proper solution.
    please help

    Restore the iOS software.
    Transfer purchases into iTunea, backup your iPad, restore to factory settings, restore from the backup and sync with iTunes and then try again.
    iTunes: Restoring iOS software - Support - Apple

  • How to create java classes when multiple xsd files with same root element

    Hi,
    I got below error
    12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. 'resultClass' is already defined
    12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. (related to above error) the first definition appears here
    12/08/09 16:26:38 BST: Build errors for viafrance; org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.7.1:generate': Mojo execution failed.
    I tried genarate java classes from multiple xsd files, but getting above error, here in .xsd file i have the <xe: element="resultClass"> in all .xsd files.
    So I removed all .xsd files accept one, now genarated java classes correctly. but i want to genarte the java classes with diffrent names with out changing .xsd
    Can you please tell me any one how to resolve this one......
    regards
    prasad.nadendla

    Gregory:
    If you want to upload several Java classes in one script the solution is .sql file, for example:
    set define ?
    create or replace and compile java source named "my.Sleep" as
    package my;
    import java.lang.Thread;
    public class Sleep {
    public static void main(String []args) throws java.lang.InterruptedException {
    if (args != null && args.length>0) {
    int s = Integer.parseInt(args[0]);
    Thread.sleep(s*1000);
    } else
    Thread.sleep(1000);
    create or replace and compile java source named "my.App" as
    package my;
    public class App {
    public static void main(String []args) throws java.lang.InterruptedException {
    System.out.println(args[0]);
    exit
    Then the .sql file can be parsed using the SQLPlus, JDeveloper or SQLDeveloper tools.
    HTH, Marcelo.

  • Multiple buttons on a single slide each connecting to a different url

    Using a trial version of Captivate 7.  I have a handful of slides where the customer wants to open different forms via url.  I tried using a button for each link, inserting the url and using the "enter" key for each of the multiple buttons.  Works fine with the mouse but for 508 folks who tab to the URL and hit the enter key ......... I get many instances where the incorrect url is activated.  Is there a way around this without assicning a different shortcut key for buttons where thare are more than one on a single slide?     Thanks

    Welcome to AD!
    Here is an article on using multiple ipods. I suggest method 1 and steer clear of method 3.
    http://support.apple.com/kb/HT1495
    For your point #1, sharing music on same PC between users, put it in a shared library & set permissions as directed here
    http://support.apple.com/kb/HT1203
    For #2, itunes doesn't have the capability to monitor folders for new content. You'll need to get something like the free program 'itunes folder watch'.

  • Programming backspace function in a java calculator.

    I am doing a java calculator.
    I want to program the backspace function, here is the code I have:
    private void jbbackspaceMouseClicked(java.awt.event.MouseEvent evt) {                                        
    // TODO add your handling code here:
    caja=Float.valueOf(jtfpantalla.getText()).floatValue();
    if(caja==0){
    jtfpantalla.setText("0");
    else{
    char caja2;
    caja2=Float.toString(caja);
    caja2.getChars(0,24,caja2,0);
    jtfpantalla.setText(String.valueOf(caja));
    Netbeans sends me 2 errors. I don't know how to use caja, as string or as an array. I want to convert it ,to print the characters of the array except the last character when the backspace button will be pressed.
    I want to count the decimal point as another character, and print the characters except the last two when the decimal point is the penultime in the array.

    I'd suggest that you store the temporary or displayed value in the calculator as a List of characters, or a String, and then don't ever turn it into a number until someone pushes the '=' button.
    That's assuming I know what you're doing, which maybe I don't.

  • Condition value of Tax gets wrongly added to Total value of Contract

    Hi All,
    I'm currently investigating an issue where there are 2 line items in an SAP Sales Contract. There is a human error in the second line where the billing end date is less than billing start date in the billing plan. Consequently, the second line has null Outgoing target value.
    However, the header Total value in the Contract gets wrongly calculated as Basic condition value of 1st line + Condition value of tax condition type of line one due to this. When I modify the billing end date for the second line item to be a date greater than the billing start date, the above problem disappears and the total value of the contract does not include the tax component.
    For eg.
    Normal Error free Contract
    Total Value at Header = 700.00 EUR
    Material  Outgoing Target val
    Item 0010  MAT1 450.00 ( 450 + 50 (tax ) )
    Item 0020 MAT2 150.00
    Contract with billing plan error in second line
    Total value at Header = 550.00 EUR
    MAterial Outgoing target val
    Item 0010 MAT1 450.00 ( 450 + 50 (tax ) )
    Item 0020 MAT2 0.00
    Any inputs would be most welcome.
    Regards,
    Venkatesh.

    Got the solution by making the condition type as manual.
    Thanks.
    Dhruba

Maybe you are looking for