Correct answer? (SQL)

I am reading the following question from a book.
If we are required to construct an equi join of 30 tables, how many join
conditions will be required?
a. 30
b. 20
c. 29
d. The number cannot be determined
I wonder what is the correct answer to the following question C or D?
The book says correct is C.
The theory says
"To join n tables together, you need a minimum of n-1 join conditions.
For example, to join four tables, a minimum of three joins is required.
This rule may not apply if your table has a concatenated primary key,
in which case more than one column is required to uniquely identify each row."
What should I answer if this question was in a 1Z0-051 test?
I would answer D. Is it wrong?

Hi,
As others have said, the question is vague.  What does it mean for 30 tables to be equijoined?  Does "a.col1=b.col1 AND a.col2=c.col2" count as 1 join condition or 2?  The best you can do is rule out the answers that don't make any sense, and guess at what the author wants from the remaining choices.
In this problem, the answerrs 20 and 30 don't make any sense.  No matter what assumptions or definitions you make, any reasoning that results in an answer of 20 could also wiork for 19, or 21, or 30, that is, "the number cannot be determined".
So the remaining choices are "29" and "the number cannot be determined".  I would guess they want "29", but that's just a guess.  As mentioned already, if you are joining N tables, and none of the joins are unconditional (that is, cross joins), then you need N-1 join conditions, counting compound conditions such as "a.col1=b.col1 AND a.col2=c.col2" as 1 condition.  (It doesn't matter if all, or any, of the conditions are equi-joins.)

Similar Messages

  • What is the correct answer is this question is sql ?

    hi .. please i need correct answer in this question ..
    View the Exhibit and examine the structure of the PRODUCTS table.
    Using the PRODUCTS table, you issue the following query to generate the names, current list price, and
    discounted list price for all those products whose list price falls below $10 after a discount of 25% is applied
    on it.
    SQL>SELECT prod_name, prod_list_price,
    prod_list_price - (prod_list_price * .25) "DISCOUNTED_PRICE"
    FROM products
    WHERE discounted_price < 10;
    The query generates an error.
    What is the reason for the error?
    A-The parenthesis should be added to enclose the entire expression.
    B-The double quotation marks should be removed from the column alias.
    C-The column alias should be replaced with the expression in the WHERE clause.
    D-The column alias should be put in uppercase and enclosed with in double quotation marks in the WHERE clause.

    Hi,
    Have you taken the time to determine what happens when you perform the requested actions?
    If you have access to Oracle Database it should be less than a 10 minute exercise.
    At a minimum, using hosted Oracle Application Express you have access to Oracle Database.
    If you've done it, what were the results? There should be a telling error message.
    Regards,
    Mark

  • Retrieve alert values for use as parameter in corrective action sql script

    I am trying to write a corrective action sql script to kill a session that is blocking other sessions. I have the "blocking session count" metric set and the alert is firing correctly.
    Is there any way to retrieve the sid and serial number from the alert generated and use it in a corrective action sql script?
    Here is the alert generated:
    Target Name=myproddb.world
    Target Type=Database Instance
    Host=myprodserver
    Metric=Blocking Session Count
    Blocking Session ID=SID: 522 Serial#: 5228
    Timestamp=Mar 4, 2008 5:57:12 PM EST
    Severity=Warning
    Message=Session 522 is blocking 1 other sessions
    Notification Rule Name=Testing Corrective actions
    Notification Rule Owner=sysman
    Clearly the sid, and serial # is contained within the alert Message field
    what I want to write for the sql script is :
    alter system kill session '%sid%,%serial_no%' immediate;
    and have GC pass in the sid and serial_no to the script.
    The "Target Properties" listed on the right of the Edit Corrective Action screen lists minimal details pertaining to the alert and certainly not the session sid, serial no.
    Generically, is there any way to retrieve the values from an alert and use them in a corrective action script or job?
    I've looked into getting the values from the mgmt$alert_history table, but I'm hoping that GC can pass the values to the sql script.
    thanks in advance for your help.

    Hi
    You can implementing a procedure like this.
    1. When a block session count alarms occurs, there is a column in the v$lock that you can examine.
    #!/bin/ksh
    #kill_block_session.sh
    #first export your variables
    export ORACLE_HOME=/oracle/product/10.2.0.3
    export ORACLE_SID=SIDNAME
    $ORACLE_HOME/bin/sqlplus "/ as sysdba" << EOF
    execute immediate killed_blocks;
    EOF
    # end
    The killed_blocks is a procedure:
    create procedure
    declare
    v_sid varchar2(15);
    v_serial varchar2(15);
    -- now a sql query that retrieve the sid and serial
    -- you can obtain these values from v$session and v$lock
    select vs.sid,vs.serial into v_sid,v_serial
    from v$session vs,v$lock vl
    where vs.sid=vl.sid
    and vl.block >0
    -- After this, you execute a dbms_put line with these
    -- values
    But you understant that this response action is very dangerous, because its possible that you kill sessions that the blocking are transitient.
    You must examine your enviroment and your application and establish the metric like UDM and not for only session blocking count.
    You must to see:
    - The type of block
    - The ctime time in the v$lock for to understatn the amount of time to determine that the block is need killed.
    - In my opinion you need a special UDM and deactivate the blocking sesion count
    If you want help to create this UDM send me a mail to [email protected]
    Regards
    Robert

  • Need Help in correcting the sql statement

    H Experts,
    I am not if I can post this query in this section, but as I am executing this statement on repository DB , I assumed to post here.
    I have a requirement to calculate the database sizes from the tables in repository.
    table 1 : MGMT$DB_TABLESPACES_ALL : has the information on all the tablespace information from each database. and it has information of all the databases.
    table 2: MGMT$DB_REDOLOGS_ALL : has the information on all the redolog files information from each database. and it has information of all the databases.
    Now to calculate the size of each database , we need to collect the sizes from both tables and then need to add.
    below is the sql i prepared and sql didn't return and systax error , but the final output is completely wrong. Seems like its multiplying the data somewhere and getting the wrong information.
    please help me in doing the required modifications.
    =================================================================================================
    select a.TARGET_NAME "DATABASE_NAME" ,sum(a.TABLESPACE_SIZE/1024/1024/1024)+sum(b.LOGSIZE/1024/1024/1024/1024) "DATABASE ALLOCATED SPACE(GB)",
    sum(a.TABLESPACE_USED_SIZE/1024/1024/1024)+sum(b.LOGSIZE/1024/1024/1024/1024) "DATABASE USED SPACE(GB)",
    sum(a.TABLESPACE_SIZE/1024/1024/1024)-sum(a.TABLESPACE_USED_SIZE/1024/1024/1024) "DATABASE FREE SPACE(GB)"
    from MGMT$DB_TABLESPACES_ALL a ,MGMT$DB_REDOLOGS_ALL b
    where a.TARGET_NAME=b.TARGET_NAME and a.TARGET_Name like '%d2oem%'
    group by a.target_name;
    ====================================================================================================
    Note: There are multiple records having the same TARGET_NAME value in both the tables.
    please Help me in correcting the sql statement

    H Experts,
    I am not if I can post this query in this section, but as I am executing this statement on repository DB , I assumed to post here.
    I have a requirement to calculate the database sizes from the tables in repository.
    table 1 : MGMT$DB_TABLESPACES_ALL : has the information on all the tablespace information from each database. and it has information of all the databases.
    table 2: MGMT$DB_REDOLOGS_ALL : has the information on all the redolog files information from each database. and it has information of all the databases.
    Now to calculate the size of each database , we need to collect the sizes from both tables and then need to add.
    below is the sql i prepared and sql didn't return and systax error , but the final output is completely wrong. Seems like its multiplying the data somewhere and getting the wrong information.
    please help me in doing the required modifications.
    =================================================================================================
    select a.TARGET_NAME "DATABASE_NAME" ,sum(a.TABLESPACE_SIZE/1024/1024/1024)+sum(b.LOGSIZE/1024/1024/1024/1024) "DATABASE ALLOCATED SPACE(GB)",
    sum(a.TABLESPACE_USED_SIZE/1024/1024/1024)+sum(b.LOGSIZE/1024/1024/1024/1024) "DATABASE USED SPACE(GB)",
    sum(a.TABLESPACE_SIZE/1024/1024/1024)-sum(a.TABLESPACE_USED_SIZE/1024/1024/1024) "DATABASE FREE SPACE(GB)"
    from MGMT$DB_TABLESPACES_ALL a ,MGMT$DB_REDOLOGS_ALL b
    where a.TARGET_NAME=b.TARGET_NAME and a.TARGET_Name like '%d2oem%'
    group by a.target_name;
    ====================================================================================================
    Note: There are multiple records having the same TARGET_NAME value in both the tables.
    please Help me in correcting the sql statement

  • I seem to not enter the correct answers to my security questions for itunes to buy an in-app purchase and also cannot answer the questions exactly like i answered them when creating the account for my ipod, how do i find out what answers i put

    I seem to not enter the correct answers to my security questions for itunes to buy an in-app purchase and also cannot answer the questions exactly like i answered them when creating the account for my ipod, how do i find out what answers i put for my ipod touch and itunes?

    Try these previous discusssions:
    recover answers to security questions: Apple Support Communities
    how do i change apple ID security...: Apple Support Communities

  • Hello ! When i will Buy a Movie in iTunes, they ask me two Security Questions and i have forget the 2 correct answers. Can you help me please ??

    Hello ! When i will Buy a Movie in iTunes, they ask me two Security Questions and i have forget the 2 correct answers. Can you help me please ??

    Blue, and Mr. Frisky...

  • How can I mark something as 'helpful'  or 'the correct answer' ?

    I have been posting a handful of questions within the DreamweaverCC forum.
    I notice that there indications that 5 people have marked the replies as 'helpful'.
    How can I mark some of the responses to my posts as helpful ?
    I am unable to do this.
    Under my 'Actions' button it says "no actions available".
    I also do not have the ability to edit my own posts.
    For instance, I have resolved one of the problems and I would like to clean up my own post eliminating the 'noise' and leaving the relevant.
    This is for the sake of others.  I have noticed that one of my posts has 200+ views.  I do not want to waste people's time.
    During the first week of may, the Adobe FORUMS had a message for a couple of days that they were doing a major overhaul of the Forum.
    Since then I am unable to sign in to the forums (or to Adobe.com) from my ipad.
    I upgraded my IOS, and cleared cookies and history.
    note.  Today I was doing a general search on my ipad (w/o) logging in.
    I wanted to see what was out there about header.php.
    I came across my own post (which requires cleanup).
    I came across another person's.  It made me laugh.
    The individuals who were helping him asked him to post his code
    which ultimately ended up in the longest scroll in the world  (hundreds of div ids).
    The responders said 'nightmare'.
    It made me laugh because I am certain that part of my posts elicit the same response (nightmare)
    I would like to clean them up.

    Thanks Hans-Günter.
    Yes, I have noticed that elsewhere. I just do not have those options.
    Okay.  After I clicked my own response to you - then the greenStar 'correct answer showed up.
    So I clicked the 'greenstar' on your response.
    Guess what ?
    Earlier, I emailed Preran because there weren't any options under my 'Actions' button for instance 'edit or 'delete'.
    They are now there !!
    Preran
    hans-g.
    thanks !!
    What is the best way to navigate to my own posts so that I can follow them ?
    The only way I can do this is by clicking on my inbox & activity under my profile icon.
    There is a list of the latest responses and emails but it is not really a list of my own posts.

  • What are the correct answers ?

    after doing one sample swing application, i assumed the exam will be easy. when i took the exam, i couldn't do anything...
    what are the correct answers ??/
      Which one of the following converts the Image i into the BufferedImage bi? 
    Choice 1  
    bi = new BufferedImage(0, 0, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = (Graphics2D)bi.createGraphics();
    g.drawImage(i,i.getHeight(this),i.getWidth(this)); 
    Choice 2  
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);
    bi.drawImage(i,0,0,this); 
    Choice 3  
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);
    Graphics2D g = (Graphics2D)bi.createGraphics();
    g.drawImage(i,0,0,this); 
    Choice 4  
    bi = new BufferedImage(i, i.getWidth(this), i.getHeight(this), BufferedImage.TYPE_INT_RGB); 
    Choice 5  
    bi = new BufferedImage(i, i.getWidth(this), i.getHeight(this)); 
    CardLayout
    BorderLayout
    FlowLayout
    GridBagLayout
    GridLayout 
      Which one of the following indicates all of the layout managers (from the list above) that allow you to set the space between the components from an instance of the LayoutManager itself? 
    Choice 1  
    CardLayout, FlowLayout, GridBagLayout, GridLayout 
    Choice 2  
    GridBagLayout 
    Choice 3  
    BorderLayout, GridLayout 
    Choice 4  
    BorderLayout, FlowLayout, GridLayout 
    Choice 5  
    BorderLayout, CardLayout, FlowLayout, GridBagLayout, GridLayout 
    JFrame jf = new JFrame();
    jf.setSize(400,400);
    JTextField jtf = new JTextField("JTextField");
    JButton jb = new JButton("JButton");
    jf.getContentPane().setLayout(
                          new FlowLayout(FlowLayout.LEFT,1,2));
    jf.getContentPane().add(jtf);
    jf.getContentPane().add(jb); 
      Which one of the following indicates the positions of the JTextField jtf and JButton jb relative to the JFrame and each other? 
    Choice 1  
    jtf and jb are in the top-center of the Jframe; jtf is to the left of jb, 2 pixels apart. 
    Choice 2  
    jb is in the top-right corner of the JFrame with jtf 1 pixel to the left of it. 
    Choice 3  
    jtf is in the top-left corner of the JFrame with jb 1 pixel to the right of it. 
    Choice 4  
    jb is in the top-right corner of the JFrame with jtf 2 pixels to the left of it. 
    Choice 5  
    jtf is in the top-left corner of the JFrame with jb 2 pixels to the right of it
    public void drawText(Graphics2D g, String text){
      Font f = new Font("Century Gothic", Font.BOLD, 10);
      g.setFont(f);
      g.drawString(text, 20, 20);
      Given the above sample code, what happens if the "Century Gothic" font is NOT available? 
    Choice 1  
    The Font() constructor fails, causing "f" to be null, and the setFont() method throws a NullPointerException. 
    Choice 2  
    "Century Gothic" is a built in Java font, which always exists within the Java runtime environment. 
    Choice 3  
    The code does not compile because only the following "logical" font names are supported in Java: Dialog, DialogInput, Monospaced, Serif, SansSerif, and Symbol. 
    Choice 4  
    The Font() constructor throws an IllegalArgumentException. 
    Choice 5  
    A default Font object is returned and is used
    Sample Code 
    public void drawText(Graphics2D g, String text){
      Font f = new Font("Century Gothic", Font.BOLD, 10);
      g.setFont(f);
      g.drawString(text, 20, 20);
      Given the above sample code, what happens if the "Century Gothic" font is NOT available? 
    Choice 1  
    The Font() constructor fails, causing "f" to be null, and the setFont() method throws a NullPointerException. 
    Choice 2  
    "Century Gothic" is a built in Java font, which always exists within the Java runtime environment. 
    Choice 3  
    The code does not compile because only the following "logical" font names are supported in Java: Dialog, DialogInput, Monospaced, Serif, SansSerif, and Symbol. 
    Choice 4  
    The Font() constructor throws an IllegalArgumentException. 
    Choice 5  
    A default Font object is returned and is used. 
    How must do you interact with a JTextField in order to generate an ActionEvent? 
    Choice 1  
    Tab into the JTextField from another Component. 
    Choice 2  
    Type in the JTextField. 
    Choice 3  
    Activate the cursor in the JTextField. 
    Choice 4  
    Hit <RETURN> while the cursor is in the JTextField. 
    Choice 5  
    Hit the spacebar while typing in the JTextField. 
    double-buffering
    public class TimerTest implements ActionListener{
      public static void main(String[] args){
        TimerTest test = new TimerTest();
        javax.swing.Timer timer = new javax.swing.Timer(100,test);
      public void actionPerformed(ActionEvent ev){
        System.out.println("Timer ticked.");
      Given the above sample code, what is the result when the code is run? 
    Choice 1  
    The words "Timer ticked." are printed to the console once after 100 milliseconds. 
    Choice 2  
    The words "Timer ticked." are printed to the console every 100 microseconds. 
    Choice 3  
    The words "Timer ticked." are printed to the console every 100 seconds. 
    Choice 4  
    The words "Timer ticked." are printed to the console every 100 milliseconds. 
    Choice 5  
    Nothing, the Timer is not started. 
    1. JSlider slider1 = new JSlider (JSlider.VERTICAL, 0, 100, 50);
    2. slider1.setPaintTicks(false);
    3. slider1.setMajorTickSpacing(10);
    4. slider1.setMinorTickSpacing(2); 
      What changes do you have to make to the above Sample code so that there are six Major Ticks and four Minor ticks between each Major Tick? 
    Choice 1  
    Replace line 3 with slider1.setMajorTickSpacing(17); 
    Choice 2  
    Replace line 2 with slider1.setPaintTicks(true);
    Replace line 3 with slider1.setMajorTickSpacing(17);
    Replace line 4 with slider1.setMinorTickSpacing(5); 
    Choice 3  
    Replace line 3 with slider1.setMajorTickSpacing(5);
    Replace line 4 with slider1.setMinorTickSpacing(4); 
    Choice 4  
    Replace line 2 with slider1.setPaintTicks(true);
    Replace line 3 with slider1.setMajorTickSpacing(20);
    Replace line 4 with slider1.setMinorTickSpacing(4); 
    Choice 5  
    Replace line 4 with slider1.setMinorTickSpacing(6); 
       Which one of the following defines a set of three JRadioButtons (b1, b2, and b3) so that only one JRadioButton can be selected at a time? 
    Choice 1  
    ButtonGroup g = new ButtonGroup();
    g.add(b1); g.add(b2); g.add(b3); 
    Choice 2  
    b1.group(true); b2.group(true); b3.group(true); 
    Choice 3  
    JRadioButton jbs[] = {b1, b2, b3};
    ButtonGroup g = new ButtonGroup(jbs); 
    Choice 4  
    The default behavior of JRadioButtons is such that only one can be selected at a time as long as they are in the same Container. 
    Choice 5  
    ButtonGroup g = new ButtonGroup(b1, b2, b3); 
    Sample Code 
    public static void main(String args[]){
      What is the role of the method in the code above? 
    Choice 1  
    To provide a place for initialization code when instantiating the current class. 
    Choice 2  
    It is the first method run when a class is run with the Java Interpreter. 
    Choice 3  
    It serves no specific function. It is a residual method from Java 1.0. 
    Choice 4  
    It is the first method that the Java Compiler converts to bytecode when creating a .class file. 
    Choice 5  
    To process command-line parameters when running the Java Interpreter 
    How do you create a menu item, Save, with a shortcut key of Ctrl+S? 
    Choice 1  
    You have to override the KeyPressed event of the top level Frame and handle the Ctrl+S to call the menu item's actionPerformed. 
    Choice 2  
    JMenuItem save = new JMenuItem("Save");
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK)); 
    Choice 3  
    JMenuItem save = new JMenuItem("Save");
    save.enableShortcut(KeyEvent.CTRL_KEY + KeyEvent.S); 
    Choice 4  
    JMenuItem save = new JMenuItem("Save");
    save.setMnemonic("Ctrl+S"); 
    Choice 5  
    JMenuItem save = new JMenuItem("Save");
    save.addShortcutKey( new KeyStroke(KeyStroke.S | KeyStroke.CTRL_KEY) ); 
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1);
    gbl.addLayoutComponent(jb,gbc1); 
      In regards to the above code, which one of the following indicates jb's grid position? 
    Choice 1  
    Grid position 2,1 
    Choice 2  
    Grid position 1,2 
    Choice 3  
    Grid position 1, 1 
    Choice 4  
    Grid position 10, 1 
    Choice 5  
    Grid position 1, 3 
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1);
    gbl.addLayoutComponent(jb,gbc1); 
      In regards to the above code, which one of the following indicates jb's grid position? 
    Choice 1  
    Grid position 2,1 
    Choice 2  
    Grid position 1,2 
    Choice 3  
    Grid position 1, 1 
    Choice 4  
    Grid position 10, 1 
    Choice 5  
    Grid position 1, 3 
    Which one of the following is necessary when changing an Applet to a standalone application? 
    Choice 1  
    Add a no-argument constructor. 
    Choice 2  
    Remove the init(), start() and stop() methods. 
    Choice 3  
    Remove "extends JApplet" or "extends Applet". 
    Choice 4  
    Add a main() method. 
    Choice 5  
    Change the import statement so that it imports an Application container rather than Applet or JApplet. 
    Which one of the following adds the String "Java" to the JComboBox jcb? 
    Choice 1  
    ComboBoxModel cbm = jcb.getModel();
    cbm.addItem("Java"); 
    Choice 2  
    jcb.setText("Java"); 
    Choice 3  
    ComboBoxModel cbm = jcb.getModel();
    cbm.add("Java"); 
    Choice 4  
    jcb.add("Java"); 
    Choice 5  
    jcb.addItem("Java");

    I'll have a go but I am not saying they are all correct...
    Question 1.
    Which one of the following converts the Image i into the BufferedImage bi?
    Choice 3 (assuming this implements the imageobserver interface)
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);  //1 is BufferedImage.TYPE_INT_RGB
    Graphics2D g = (Graphics2D)  
    bi.createGraphics();
    g.drawImage(i,0,0,this);Good luck with your homework...
    nes
    Question 2.
    CardLayout
    BorderLayout
    FlowLayout
    GridBagLayout
    GridLayout
    Which one of the following indicates all of the layout managers (from the list above) that allow you to set the space between the components from an instance of the LayoutManager itself?
    Choice 4
    BorderLayout,
    FlowLayout,
    GridLayout
    (GridBagLayout uses GridBagConstraints to decide component spacing, card layout does not provided component spacing due to the deck nature used)
    Question 3.
    JFrame jf = new JFrame();
    jf.setSize(400,400);
    JTextField jtf = new JTextField("JTextField");
    JButton jb = new JButton("JButton");
    jf.getContentPane().setLayout( new FlowLayout(FlowLayout.LEFT,1,2));
    jf.getContentPane().add(jtf);
    jf.getContentPane().add(jb);    Which one of the following indicates the positions of the JTextField jtf and JButton jb relative to the JFrame and each other?
    Choice 3 jtf is in the top-left corner of the JFrame with jb 1 pixel to the right of it.
    Question 4
    public void drawText(Graphics2D g, String text)
         Font f = new Font("Century Gothic", Font.BOLD, 10);  
         g.setFont(f);  
         g.drawString(text, 20, 20);
    }    Given the above sample code, what happens if the "Century Gothic" font is NOT available?
    Choice 5 A default Font object is returned and is used
    Question 5.
    How must do you interact with a JTextField in order to generate an ActionEvent?
    Choice 4 Hit <RETURN> while the cursor is in the JTextField.
    Question 6.
    public class TimerTest implements ActionListener
         public static void main(String[] args)
               TimerTest test = new TimerTest();    
               javax.swing.Timer timer = new javax.swing.Timer(100,test);  
         public void actionPerformed(ActionEvent ev)
              System.out.println("Timer ticked.");  
    }    Given the above sample code, what is the result when the code is run?
    Choice 5 Nothing, the Timer is not started.
    Question 7.
    1. JSlider slider1 = new JSlider (JSlider.VERTICAL, 0, 100, 50);
    2. slider1.setPaintTicks(false);
    3. slider1.setMajorTickSpacing(10);
    4. slider1.setMinorTickSpacing(2);    What changes do you have to make to the above Sample code so that there are six Major Ticks and four Minor ticks between each Major Tick?
    Choice 4 Replace line 2 with slider1.setPaintTicks(true); Replace line 3 with slider1.setMajorTickSpacing(20); Replace line 4 with slider1.setMinorTickSpacing(4);
    Question 8.
    Which one of the following defines a set of three JRadioButtons (b1, b2, and b3) so that only one JRadioButton can be selected at a time?
    Choice 1 ButtonGroup g = new ButtonGroup(); g.add(b1); g.add(b2); g.add(b3);
    Question 9.
    Sample Code
    public static void main(String args[]){ }
    TYPO - should be public static void main(String[] args){ }
    What is the role of the method in the code above?
    Choice 2 It is the first method run when a class is run with the Java Interpreter.
    Question 10.
    How do you create a menu item, Save, with a shortcut key of Ctrl+S?
    Choice 2 JMenuItem save = new JMenuItem("Save");
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK));
    Question 11.
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1); gbl.addLayoutComponent(jb,gbc1);
    In regards to the above code, which one of the following indicates jb's grid position?
    Choice 3 Grid position 1, 1
    Question 12
    Which one of the following is necessary when changing an Applet to a standalone application?
    Choice 1 Add a no-argument constructor.
    Choice 2 Remove the init(), start() and stop() methods.
    Choice 3 Remove "extends JApplet" or "extends Applet".
    Choice 4 Add a main() method.
    Choice 5 Change the import statement so that it imports an Application container rather than Applet or JApplet.
    mmm. not a good choice of answers. look at the following link...
    http://forum.java.sun.com/thread.jsp?forum=57&thread=218096
    Question 13.
    Which one of the following adds the String "Java" to the JComboBox jcb?
    Choice 5 jcb.addItem("Java");

  • Setting XML based exam to where there are two correct answers in a question

    I have an exam which pulls in questions from an XML file and to indicate what the correct answer is you would indicate in the XML as such:
    PROBLEM id="1">
                    <QUESTION>What is the State Capital of California:</QUESTION>
                    <CHOICE letter="a">San Fransisco.</CHOICE>
                    <CHOICE letter="b">San Diego.</CHOICE>
                    <CHOICE letter="c">Los Angelas.</CHOICE>
                    <CHOICE letter="d" correct="true">Sacremento.</CHOICE>
                </PROBLEM>
    There is one question, that is structured so there are two right answers, but when I add correct="true" to both answers I want as right only one is calculated correctly in the scoring. I thinking I need to make an adjustment in the code that pulls in the XML, but not sure where. Hoping someone can help.
    Here is the AS code.
    package exam {
        import flash.net.* //to create URLRequest and load XML file
        import flash.events.* //for Load events
        //import flash.display.* //for testing purposes - remove when testing complete
        //This class downloads the XML document, and then inserts info into arrays and variables.
        //Also provides text of questions and correct answers when requested.
        internal class XaMLDiplomat extends EventDispatcher {
            //VARIABLES:
            //for loaded XML doc
            private var myXML:XML;
            //for loading in XML
            private var examLoader:URLLoader;
            private var numQstns:Number; //count of total questions in a section
            private var sectStart:Number;
            //contains exam questions - ALL ARRAYS ARE ZERO RELATIVE -> actual question numbers = array index + 1
            private var questions:Array;
            //contain associated answer choices
            private var choiceA:Array;
            private var choiceB:Array;
            private var choiceC:Array;
            private var choiceD:Array;
            private var choiceE:Array;
            private var choiceF:Array;
            //array of the correct answers
            private var answers:Array;
            //use custom Mixer class to randomize order
            private var myMixer:Mixer;
            private var isRandom:Boolean;
            //CONSTRUCTOR
            public function XaMLDiplomat () { //NEED TO ADD ARGUMENTS (docLocation)
                //create URLRequest from argument
                var examSite:URLRequest = new URLRequest("protected/exam.xml");
                //create a loader for the XML
                examLoader = new URLLoader();
                //add listener for load completion
                examLoader.addEventListener(Event.COMPLETE, fullyLoaded);
                examLoader.load(examSite);
                //var ugly:Mixer = new Mixer(25);
            //Load listener - creates XML object, and checks it for multiple sections. If multiple, it asks users
            //which section they want - FIRST it needs to check database for any completed sections.
            //If single, it goes ahead and starts array creation for first (& only) section
            private function fullyLoaded (e:Event):void {
                myXML = new XML(examLoader.data);
                //myXML.prettyPrinting = false;
                //still need to pull out SYSTEM data and pass it along...
                var system:XMLList = myXML..SYSTEM;
                var sysObj:Object = new Object();
                sysObj.examTitle = system.TITLE.toString();
                sysObj.totalMin = system.MINUTES.toString();
                sysObj.retakePW = system.RETAKEPW.toString();
                var numSections:Number = myXML..SECTION.length();
                if (numSections == 1) {
                    generateArrays(1);
                dispatchEvent(new MultiSectEvent(MultiSectEvent.SECTIONS, numSections, sysObj));
            //Assigns arrays to instance variables for the selected section
            internal function generateArrays (sectn:Number):void {
                var whichSection:XMLList = myXML..SECTION.(@id == String(sectn));
                var probList:XMLList = whichSection.PROBLEM;
                numQstns = probList.length();
                sectStart = Number(probList[0].@id);
                questions = new Array();
                choiceA = new Array();
                choiceB = new Array();
                choiceC = new Array();
                choiceD = new Array();
                choiceE = new Array();
                choiceF = new Array();
                answers = new Array();
                for (var i:Number=0; i<numQstns; i++) {
                    var curProb:XMLList = probList.(@id == String(i+1));
                    if (curProb.QUESTION.hasSimpleContent()) {
                        questions[i] = curProb.QUESTION.toString();
                    }else {
                        //trace(curProb.QUESTION.toXMLString());
                        questions[i] = dropTags(curProb.QUESTION[0]);
                    choiceA[i] = curProb.CHOICE.(@letter == "a").toString();
                    choiceB[i] = curProb.CHOICE.(@letter == "b").toString();
                    choiceC[i] = curProb.CHOICE.(@letter == "c").toString();
                    choiceD[i] = curProb.CHOICE.(@letter == "d").toString();
                    choiceE[i] = curProb.CHOICE.(@letter == "e").toString();
                    choiceF[i] = curProb.CHOICE.(@letter == "f").toString();
                    answers[i] = curProb.CHOICE.(hasOwnProperty("@correct") && @correct == "true")[email protected]();
                //randomizing test
                //var makeRandom:Boolean;
                //system.RANDOM.toString() ==  'true' ? makeRandom = true : makeRandom = false;
                //myMixer = new Mixer(numQstns,makeRandom);
                trace("Question: "+questions[3]);
                trace("a: "+choiceA[3]);
                trace("b: "+choiceB[3]);
                trace("c: "+choiceC[3]);
                trace("d: "+choiceD[3]);
                trace("\r\n answer: "+answers[3]); */
            //method for external classes to acquire text of current exam question
            internal function getQuestion (qnum:Number):Object {
                var returnObj:Object = new Object();
                var randomQ:Number = myMixer.getRandomNumber(qnum-1);
                returnObj.q = questions[randomQ];
                returnObj.ca = choiceA[randomQ];
                returnObj.cb = choiceB[randomQ];
                returnObj.cc = choiceC[randomQ];
                returnObj.cd = choiceD[randomQ];
                returnObj.ce = choiceE[randomQ];
                returnObj.cf = choiceF[randomQ];
                returnObj.num = qnum;
                //trace(randomQ);
                return returnObj;
            private function dropTags (txt:XML):String {
                var txtString:String = "";
                for each (var child:XML in txt.*) {
                    if (child.nodeKind == "text") {
                        txtString += child.toString();
                    }else {
                        txtString += " " + child.toXMLString();
                //trace(txtString);
                return txtString;
            private function dropTags (txt:String):String {
                var sliceStart:Number = txt.indexOf(">");
                var sliceStop:Number = txt.lastIndexOf("<");
                return txt.slice((sliceStart+1), sliceStop);
            internal function getAnswer (num:Number):String {
                return answers[num];
            internal function getQCount ():Number {
                return numQstns;
            internal function getSectStart():Number {
                return sectStart;
            internal function getRealNum (num:Number):Number {
                return myMixer.getRandomNumber(num-1);

    this may or may not be the probel, but as it stands right now, when you select and anser it becomes hi-lighted and when you click off and select another answer the previous answer is deselected and the current answer is hi-lighted. I need to allow for multiple selections. This code is what is doing to current select/de-select functionality.
    package exam {
        import flash.display.*;
        import flash.events.*;
        import flash.text.*;
        //This class displays the current question, and contains the Choices for the question
        public class QMachine extends Sprite {
            //VARIABLES
            private var QObject:Object; //object from XaMLDiplomat, containing necessary text
            private var limit:Number;
            private var QNumTxt:TextField;
            private var QTxt:TextField;
            private var txtStyle:StyleSheet;
            private var choiceA:Choice;
            private var choiceB:Choice;
            private var choiceC:Choice;
            private var choiceD:Choice;
            private var choiceE:Choice;
            private var choiceF:Choice;
            //CONSTRUCTOR
            public function QMachine (hite:Number) {
                limit = hite;
                var style:Object = new Object();
                style.fontFamily = "Arial";
                //style.fontWeight = "bold";
                style.fontSize = "16";
                style.color = "#333333";
                txtStyle = new StyleSheet();
                txtStyle.setStyle("p",style);
                QNumTxt = new TextField();
                QNumTxt.styleSheet = txtStyle;
                //QNumTxt.embedFonts = true;
                QNumTxt.htmlText = "<p>1) </p>";
                QNumTxt.autoSize = TextFieldAutoSize.RIGHT;
                QNumTxt.x = 10;
                QNumTxt.mouseEnabled = false;
                QTxt = new TextField();
                QTxt.styleSheet = txtStyle;
                //QTxt.embedFonts = true;
                QTxt.width = 300;
                QTxt.multiline = true;
                QTxt.wordWrap = true;
                QTxt.autoSize = TextFieldAutoSize.LEFT;
                QTxt.htmlText = "<p>Question 1</p>";
                QTxt.x = 35;
                QTxt.mouseEnabled = false;
                addChild(QNumTxt);
                addChild(QTxt);
                choiceA = new Choice("a");
                choiceA.x = 350;
                addChild(choiceA);
                choiceB = new Choice("b");
                choiceB.x = 350;
                addChild(choiceB);
                choiceC = new Choice("c");
                choiceC.x = 350;
                addChild(choiceC);
                choiceD = new Choice("d");
                choiceD.x = 350;
                addChild(choiceD);
                choiceE = new Choice("e");
                choiceE.x = 350;
                addChild(choiceE);
                choiceF = new Choice("f");
                choiceF.x = 350;
                addChild(choiceF);
                addEventListener(MouseEvent.MOUSE_UP, selectResponse, true);
            internal function newQuestion (obj:Object, prior:String = ""):void {
                //trace(obj.num);
                QNumTxt.htmlText = "<p>"+ obj.num + ".</p>";
                QTxt.htmlText = "<p>"+ obj.q + "</p>";
                choiceA.deselect();
                choiceB.deselect();
                choiceC.deselect();
                choiceD.deselect();
                choiceE.deselect();
                choiceF.deselect();
                choiceA.resetSize();
                choiceB.resetSize();
                choiceC.resetSize();
                choiceD.resetSize();
                choiceE.resetSize();
                choiceF.resetSize();
                choiceA.changeTxt(obj.ca);
                choiceB.changeTxt(obj.cb);
                choiceB.y = choiceA.height + 5;
                if (obj.cc == undefined || String(obj.cc) == "") {
                    choiceC.visible = false;
                }else {
                    choiceC.changeTxt(obj.cc);
                    choiceC.y = choiceB.y + choiceB.height + 5;
                    choiceC.visible = true;
                if (obj.cd == undefined || String(obj.cd) == "") {
                    choiceD.visible = false;
                }else {
                    choiceD.changeTxt(obj.cd);
                    choiceD.y = choiceC.y + choiceC.height + 5;
                    choiceD.visible = true;
                if (obj.ce == undefined || String(obj.ce) == "") {
                    choiceE.visible = false;
                }else {
                    choiceE.changeTxt(obj.ce);
                    choiceE.y = choiceD.y + choiceD.height + 5;
                    choiceE.visible = true;
                if (obj.cf == undefined || String(obj.cf) == "") {
                    choiceF.visible = false;
                }else {
                    choiceF.changeTxt(obj.cf);
                    choiceF.y = choiceE.y + choiceE.height + 5;
                    choiceF.visible = true;
                var curHite:Number;
                if (choiceF.visible) {
                    curHite = choiceF.y + choiceF.height + 5;
                }else if (choiceE.visible) {
                    curHite = choiceE.y + choiceE.height + 5;
                }else if (choiceD.visible) {
                    curHite = choiceD.y + choiceD.height + 5;
                }else {
                    curHite = choiceC.y + choiceC.height + 5;
                if (curHite > (limit-150)) {
                    shrinkText();
                if (prior != "") {
                    if (prior == "a") {
                        choiceA.nowSelected();
                    }else if (prior == "b") {
                        choiceB.nowSelected();
                    }else if (prior == "c") {
                        choiceC.nowSelected();
                    }else if (prior == "d") {
                        choiceD.nowSelected();
                    }else if (prior == "e") {
                        choiceE.nowSelected();
                    }else if (prior == "f") {
                        choiceF.nowSelected();
            private function shrinkText() {
                choiceA.dropSize();
                choiceB.dropSize();
                choiceC.dropSize();
                choiceD.dropSize();
                choiceE.dropSize();
                choiceF.dropSize();
                choiceB.y = choiceA.y + choiceA.height + 5;
                choiceC.y = choiceB.y + choiceB.height + 5;
                choiceD.y = choiceC.y + choiceC.height + 5;
                choiceE.y = choiceD.y + choiceD.height + 5;
                choiceF.y = choiceE.y + choiceE.height + 5;
                var curHite:Number = 0;
                if (choiceF.visible) {
                    curHite = choiceF.y + choiceF.height + 5;
                }else if (choiceE.visible) {
                    curHite = choiceE.y + choiceE.height + 5;
                }else if (choiceD.visible) {
                    curHite = choiceD.y + choiceD.height + 5;
                }else {
                    curHite = choiceC.y + choiceC.height + 5;
                if (curHite > (limit-150)) {
                    shrinkText();
            private function selectResponse (e:MouseEvent):void {
                choiceA.deselect();
                choiceB.deselect();
                choiceC.deselect();
                choiceD.deselect();
                choiceE.deselect();
                choiceF.deselect();
                var letter:String = e.target.parent.getLetter();
                dispatchEvent(new ResponseEvent(ResponseEvent.SELECTION, letter));
            internal function setPriorResponse() {
                choiceA.deselect();
                choiceB.deselect();
                choiceC.deselect();
                choiceD.deselect();
                choiceE.deselect();
                choiceF.deselect();

  • Review Widget: "drag the correct answer to the target" - not working for me?

    Ive read the (very limited) help on this problem, and I must be doing something wrong
    I simply want to indicate the right answer A or B - couldnt be simpler.
    Apple says:
    "To indicate the correct answer: Select it or drag the label or image to the target. To have more than one correct answer, hold down the Command key while you select the answers."
    Its just not working. I assume it means drag the CHOICE A button OR CHOICE A text (thats all there is) to some target on the inspector but that doesnt work nothing happens. (And where is "the target" what target? Where? I cant find a "drop" green plus appearing anywhere..
    So I then, instead I try dragging the QUESTION TEXT (eg is the sky blue or red) to somewhere and that DOES show a draggable obkect but again where is this "target"? If that means the  Answer a or Answer B back in the widget it self then No, that doesnt do anything, no drop zone is saying "hey drop me here"
    So, like I say, I must be missing somethign really obvious. But Ive no idea. Please help.
    TP

    Hi Andy,
    I am trying to investigate this issue but I havent been able to reproduce it. It would be great if you could give me a few inputs.
    1) Are you able to Publish Comments in the review?
    2) Is there any internet traffic monitoring tool running on your machine?
    3) Close Acrobat and then try killing the AdobeCollabSync.exe from task manager. Now open the review file again and try to sync the comments. Does this work?
    4) Try downloading a fresh copy of this file from Acrobat.com server and replacing your local copy with it.
    If all these things do not work then maybe we can analyze the traffic (using fiddler) on your machine to investigate the problem.
    Thanks,
    Abhilasha

  • How do I stop Safari from 'pinwheeling' whenever I am using Yahoo Mail? I really need a correct answer please.                                                                                             Mail? I need a correct answer please.

    How do I stop Safari from 'pinwheeling' whenever I try to use Yahoo Mail?
    I really need a correct answer please. Other answers have only suggested how to access Yahoo Mail without using Safari. I want to continue using Safari to access Yahoo Mail,if possible.  Thank you.

    Could be a cookie issue...
    Go to Safari > Preferences then select the Security tab then click Show Cookies
    Type yahoo in the serach field then click Remove All > Done
    Quit then relaunch Safari.
    Try accessing your Yahoo mail account.
    FYI... there is rarely a sure fire correct response for third party web based email client software. Often takes time consuming troubleshooting.

  • SELECT STATEMENT (Correct answers will be given full points.)

    HI Gurus
                  I am new abap help me with the select statement for these please
      Get BKPF-AWKEY where BKPF-BELNR = VBRK-VBELN + prefix “00”.
    this is the reference number for printing in script(SD)
    i need to write in the text elements
    Get KNA1- STCEG where VBRK-KUNRG =  KNA1-KUNNR  This is the GST REG
    how to write in the text elements.
    Correct answers will be given full points.
    thanks & regards
    sirish.

    Hi sirish,
       First of all to add the prefix to vbrk-vbeln u can write the syntax like this-
      CONCATENATE '00' VBRK-VBELN INTO VBRK-VBELN.
    if  00 is suffix then write like this--
      CONCATENATE  VBRK-VBELN '00' INTO VBRK-VBELN.
    Now u can write ur first select query like this-
    SELECT awkey FROM    bkpf
                            WHERE belnr = vbrk-vbeln.
    Syntax for second select query-
    SELECT stceg FROM    kna1
                           WHERE kunnr = vbrk-kunrg.
    Reward if useful.
    Regards,
    Rajesh Akarte

  • How can I allow a learner to review a created Drag and Drop Quiz to show the learner their incorrect/correct answers?

    Captivate 8: I have created an assessment with two multiple choice question slides and eight drag and drop question slides. After the learner views their score, I would like them to be able to review all of their answers to see where errors were made. Currently, the review quiz only shows their answers and the correct answers for Multiple choice question slides. Ideally, I would like a review of the drag and drop question slides where the incorrect choices are outlined in red or something to this effect. I appreciate any insight and suggestions!

    Sorry, D&D is not a normal question slide and I can only recommend logging a feature request. I would really like to be able to choose whether an interaction is reset or not, because this problem doesn't exist only for D&D but for all learning interactions as well.

  • Issue with font of correct answers

    As you can see below, the correct answer provided during question review is too large to fit within the box that is provided for it. I have scoured the user manual and forums to figure out which object this is in order to change its font, but I have yet to find a list of what the names of each object (quizzing and standard) actually represent, i.e. which one to change in the object style manager in order to fix the issue below. Help?

    Hi there,
       Is it possible for you to share the published *.swf and the .Cptx file with us so that we can investigate the issue in our end. Please email the Files to: [email protected]  Also share the version  detailes of Captivate 5.5(ENG, or other Localized Version?) you are using and on which platform, Win/Mac?
    Thanks,
    Nimmy Sukumaran.
     

  • In a Quiz the Correct Answer Buttons are too close to the answer letter. How to give more space?

    When creating a quiz and previewing, the Buttons to select the correct answer are too close to the letter for the answer. How do I add space between them. Suggestions?

    I think what you mean is that the quiz question's Failure action doesn't trigger until the final attempt and that would never happen if attempts is set to Infinite.  So if you were only incrementing the variable when the quiz question registered final failure then you'd only get one crack at incrementing the variable. yes.  My bad.
    However, if you are using Multiple Choice questions, you can also trigger actions using the Advanced Answer Option.  This will trigger an action when a particular answer is selected.  So if you set this for each incorrect answer, you could increment the variable each time they select the wrong answer.
    You can also use this same Advanced Answer action to execute a conditional action that first checks the value of the variable and then shows the rollover caption or increments the variable as needed.
    Say you create a variable called WrongAnswer and initialise it with a value of 0.  Then you create a Conditional Action called CheckWrongAnswer that looks like this:
    If WrongAnswer is equal to 1 assign Wrong Answer with 2, (then on the next line) Show RolloverCaption, ELSE assign Wrong Answer with 1.
    This shows the rollover caption after the second attempt resulting in an incorrect answer.

Maybe you are looking for

  • HP Officejet Pro 8500 A909g seems to destroy printheads

    My wife and I have identical "HP Officejet Pro 8500 A909g Series" (S/N: [Edited for Personal Information] for my printer) printers bought within several months of each other. We have owned the printers since late 2009. My printer quit printing cyan c

  • How to create a Service Graph on the contract.

    Hi. all I have been trying to adapt ACI to service provider but it is difficult to fit it to SP environment. Above all service graph hasn't been worked, even though i configured all based on a document regarding service graph. ** I can't understand w

  • How to move a file when startup disk is full?

    My macbook start up disk is full, apparently. I've tried deleting things and nothing has worked. I need to safely get a video file, in mp4 from Iphoto onto a usb drive. Iphoto will not let me put the file on desktop or move anywhere. What do I do? He

  • HOW TO USE STORED PROCEDURE IN JDEVELOPER - TOPLINK

    -- I really have problem try to do that!!!.. I put the code of adf guide for toplink but have two errors: StoredProcedureCall call = new StoredProcedureCall(); call.setProcedureName("CHECK_VALID_POSTAL_CODE"); call.addNamedArgument("POSTAL_CODE"); ca

  • What Oracle Table contains Partition Key Field Name?

    What Oracle table/view maintains the partition key field name? All_Tab_Partitions does not appear to maintain such information. When I use Toad -> Schema -> Tables -> Partitions, it lists the partition key field name that the partition is based. Than