I am a rookie and need help with max and min values

Hello all, i am into this intro to java class. my assignment is to write a program that prompts the user for two integers and then prints the sum, difference, average, product , distance (absolute value of the difference) Maximum(largest of the two) and Minimum(smallest fo the two) here is my code so far
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.Math;
public class Sample4
   public static void main(String[] args) throws IOException
      try // attempt the following
{           // create the stream to read from
InputStreamReader istream = new InputStreamReader(System.in);   // create a buffer to hold the stream
BufferedReader console = new BufferedReader(istream);           // prompt the user
      System.out.println("Enter a number please");              // get input as a string
      String input = console.readLine();                        // convert to an integer
      int num1 = Integer.parseInt(input);
      System.out.println("Enter a number please");              // get input as a string
      String input2 = console.readLine();                       // convert to an integer
      int num2 = Integer.parseInt(input2);
      int sum = num1 + num2;                                    // get the sum of the two inputs
      int difference = num1 - num2;                             // get the difference of the two inputs
      int product = num1 * num2;                                // get the product of the two inputs
      int average = sum / 2;                                    // get the average of the two inputs
      int abs = Math.abs(difference);                           // get the absolute value of the two inputs
          // new section
             // display the number
      System.out.println("The total sum = " + sum);
      System.out.println("The total difference = " + difference);
       System.out.println("The total product = " + product);
       System.out.println("The total average = " + average);
       System.out.println("The total absolute value = " + abs);
} // if something breaks, catch the exception
catch (IOException e)
   System.out.println(e); // displays the exception
   System.exit(1);  // quits the program
}what will be the right syntax or code to find the MAX and MIN values of two numbers a User Inputs, hope someone can help with this. thank you for your help.

Thanks alot man, sheesh i do not know why my book
doesnt give me all the static methods. but i do really
appreciate your help. peaceA complete list of the java.lang.Math methods can be found at http://java.sun.com/j2se/1.4/docs/api/java/lang/Math.html
btw,
max(a, b) == (a > b) ? a : b
min(a, b) == (a < b) ? a : b

Similar Messages

  • New to Dreamweaver and need help with PDF and Word

    I'm trying to put forms on my web page http://www.troop4084.org and I cannot get them to show up on the internet. I have them in the folder. If there is a step-by-step process to do this?

    johnnyc54 wrote:
    I think so, that may be the issue. I'm still looking at that one to figure it out.  My pictures work fine
    and I followed the same procedure for the Word/PDF documents...
    Your images are in the 'images' folder:
    http://www.troop4084.org/Images/Anacortes%20Sign.jpg
    The pdfs are neither in the images folder or where the links says they are in the site folder itself.
    See the link below - It says the FOS.pdf is in the site folder itself. Not in any other folders.
    http://www.troop4084.org/FOS.pdf
    If you upload the FOS.pdf to the site folder on your server the link will be correct.
    or you can put the FOS.pdf in the 'images' folder and change the link to as below:
    http://www.troop4084.org/images/FOS.pdf
    or you may want to create a 'pdf' folder on your server and upload the 'pdfs' into that with the link below:
    http://www.troop4084.org/pdfs/FOS.pdf

  • New here and need help with FX1 and FCE

    Hey all -
    I shot a lot of video this last summer on a Sony FX1 in HDV. I am capturing the video using FCE. I have my Easy set up for HD, 29.97, and HDV - AIC 1080i60.
    I am in the US not using PAL.
    I can capture the video fine, and export to quicktime fine. I get what seems is good video capture with the following problem:
    My video looks fine in the view finder but once captured, it is desaturated and lacks any color.
    I do not know much else about FCE. I do not want to do much editing, just grabbing and creating some .mov files for sharing. I just want to see better color.
    Questions then...
    1. How to boost color?
    2. How to color correct for neutral density?
    3. What size is best to save as largest size and quality?
    I am viewing on a color corrected Apple Cinema Display 23" that I use to edit my photos and use Monaco Optix XR Pro with ColorEyes Pro.
    Thanks.
    Randal

    Keep in mind that computer displays will not have the same gamma and color space of NTSC or ATSC television.
    -DH

  • Project Server 2013: I am using Project Server Permission Mode and need help with permission assignments?

    Hi 
    Project Server 2013: I am using Project Server Permission Mode and need help with permission assignments?
    How can I change Permissions for the individual users to see specific projects or all projects in project center and to see specific quick launch items?
    For Example: if i have 4 users, A, B, C and D. what i want is:
    User A can see everything and act as a project manager or Admin.
    User B can view all projects in project centre but can change the schedule or resource assignment etc.
    User C can only act as approver of projects and can view all projects in project centre.
    User D can only view specific projects for which permissions are given.
    can i have some expert help in sorting and understanding permission modes... as i was playing with project server mode permissions and can't figure out how to apply the above scenario to set of my user.
    Thanks in Advance
    Cheers
    AJ
    Ajay Kumar

    Hi Ajay,
    Please refer to this link for detailed explanations about PS2013 security model. 
    http://technet.microsoft.com/en-us/library/cc197638(v=office.15).aspx
    Actually, it will take a couple of days to explain in detail the security model that is a fundamental and tricky aspect of every PS implementation. But basically, you NEVER set permissions for a single user. You have groups in which your insert users. Groups
    define "what users can do". Then you associate groups to a corresponding category. Categories define "what user can see". Thus the association of a group with a category will set "what the user can do on the objects he can see". Then, for more advanced security
    level, you can use the RBS that will consist in "branches" in which you'll insert users. Based on those branches, you'll customize categories to fine-tune what user can see (for projects and resources) depending on the RBS branch and level.
    I'd advice you to start "playing" in a test environment with the default categories/groups that might probably cover your need.
    Concerning your 4 users:
    user A : add him to the "administrator" group. Be careful that you're mentionning either project manager or administrator, which are 2 groups/categories with totally different permissions level.
    user B : basically can see everything and change everything? it could be in the project manager group, assuming that there are no project visibility restrictions on the category via the RBS.
    user C : waht do you mean by "approver"? Workflow approvals? Then it will be the portfolio manager group. Task update or timesheet approval? Then it is another long topic: please refer in the documentation to the "status manager" and "timesheet manager"
    concepts. There are not related to the security model. In a few words, the status manager is the owner of the project plan, is defined for each task and approves tasks updates. The timesheet manager is an attribute defined for each resource in its parameters
    and approves resource timesheet.
    user D : you have to define which permission level must be given to this user. Basically it could be a team member that will see only projects he's in the project team. Note that team member cannot interact with the project plan in another way than submitting
    timesheets and/or tasks updates which must be approved.
    Once more, those are large and complex subjects that require a deep dive into your business model and tons of tests in a test environment.
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • MOVED: [Athlon64] Need Help with X64 and Promise 20378

    This topic has been moved to Operating Systems.
    [Athlon64] Need Help with X64 and Promise 20378

    I'm moving this the the Administration Forum.  It seems more apporpiate there.

  • Need help with the session state value items.

    I need help with the session state value items.
    Trigger is created (on After delete, insert action) on table A.
    When insert in table B at least one row, then trigger update value to 'Y'
    in table A.
    When delete all rows from a table B,, then trigger update value to 'N'
    in table A.
    In detail report changes are visible, but the trigger replacement value is not set in session value.
    How can I implement this?

    You'll have to create a process which runs after your database update process that does a query and loads the result into your page item.
    For example
    SELECT YN_COLUMN
    FROM My_TABLE
    INTO My_Page_Item
    WHERE Key_value = My_Page_Item_Holding_Key_ValueThe DML process will only return key values after updating, such as an ID primary key updated by a sequence in a trigger.
    If the value is showing in a report, make sure the report refreshes on reload of the page.
    Edited by: Bob37 on Dec 6, 2011 10:36 AM

  • Need help with JTextArea and Scrolling

    import java.awt.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    import javax.swing.*;
    public class MORT_RETRY extends JFrame implements ActionListener
    private JPanel keypad;
    private JPanel buttons;
    private JTextField lcdLoanAmt;
    private JTextField lcdInterestRate;
    private JTextField lcdTerm;
    private JTextField lcdMonthlyPmt;
    private JTextArea displayArea;
    private JButton CalculateBtn;
    private JButton ClrBtn;
    private JButton CloseBtn;
    private JButton Amortize;
    private JScrollPane scroll;
    private DecimalFormat calcPattern = new DecimalFormat("$###,###.00");
    private String[] rateTerm = {"", "7years @ 5.35%", "15years @ 5.5%", "30years @ 5.75%"};
    private JComboBox rateTermList;
    double interest[] = {5.35, 5.5, 5.75};
    int term[] = {7, 15, 30};
    double balance, interestAmt, monthlyInterest, monthlyPayment, monPmtInt, monPmtPrin;
    int termInMonths, month, termLoop, monthLoop;
    public MORT_RETRY()
    Container pane = getContentPane();
    lcdLoanAmt = new JTextField();
    lcdMonthlyPmt = new JTextField();
    displayArea = new JTextArea();//DEFINE COMBOBOX AND SCROLL
    rateTermList = new JComboBox(rateTerm);
    scroll = new JScrollPane(displayArea);
    scroll.setSize(600,170);
    scroll.setLocation(150,270);//DEFINE BUTTONS
    CalculateBtn = new JButton("Calculate");
    ClrBtn = new JButton("Clear Fields");
    CloseBtn = new JButton("Close");
    Amortize = new JButton("Amortize");//DEFINE PANEL(S)
    keypad = new JPanel();
    buttons = new JPanel();//DEFINE KEYPAD PANEL LAYOUT
    keypad.setLayout(new GridLayout( 4, 2, 5, 5));//SET CONTROLS ON KEYPAD PANEL
    keypad.add(new JLabel("Loan Amount$ : "));
    keypad.add(lcdLoanAmt);
    keypad.add(new JLabel("Term of loan and Interest Rate: "));
    keypad.add(rateTermList);
    keypad.add(new JLabel("Monthly Payment : "));
    keypad.add(lcdMonthlyPmt);
    lcdMonthlyPmt.setEditable(false);
    keypad.add(new JLabel("Amortize Table:"));
    keypad.add(displayArea);
    displayArea.setEditable(false);//DEFINE BUTTONS PANEL LAYOUT
    buttons.setLayout(new GridLayout( 1, 3, 5, 5));//SET CONTROLS ON BUTTONS PANEL
    buttons.add(CalculateBtn);
    buttons.add(Amortize);
    buttons.add(ClrBtn);
    buttons.add(CloseBtn);//ADD ACTION LISTENER
    CalculateBtn.addActionListener(this);
    ClrBtn.addActionListener(this);
    CloseBtn.addActionListener(this);
    Amortize.addActionListener(this);
    rateTermList.addActionListener(this);//ADD PANELS
    pane.add(keypad, BorderLayout.NORTH);
    pane.add(buttons, BorderLayout.SOUTH);
    pane.add(scroll, BorderLayout.CENTER);
    addWindowListener( new WindowAdapter()
    public void windowClosing(WindowEvent e)
    System.exit(0);
    public void actionPerformed(ActionEvent e)
    String arg = lcdLoanAmt.getText();
    int combined = Integer.parseInt(arg);
    if (e.getSource() == CalculateBtn)
    try
    JOptionPane.showMessageDialog(null, "Got try here", "Error", JOptionPane.ERROR_MESSAGE);
    catch(NumberFormatException ev)
    JOptionPane.showMessageDialog(null, "Got here", "Error", JOptionPane.ERROR_MESSAGE);
    if ((e.getSource() == CalculateBtn) && (arg != null))
    try{
    if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 1))
    monthlyInterest = interest[0] / (12 * 100);
    termInMonths = term[0] * 12;
    monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest,  -termInMonths))));
    lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
    if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 2))
    monthlyInterest = interest[1] / (12 * 100);
    termInMonths = term[1] * 12;
    monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest,  -termInMonths))));
    lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
    if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 3))
    monthlyInterest = interest[2] / (12 * 100);
    termInMonths = term[2] * 12;
    monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest,  -termInMonths))));
    lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
    catch(NumberFormatException ev)
    JOptionPane.showMessageDialog(null, "Invalid Entry!\nPlease Try Again", "Error", JOptionPane.ERROR_MESSAGE);
    }                    //IF STATEMENTS FOR AMORTIZATION
    if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 1))
    loopy(7, 5.35);
    if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 2))
    loopy(15, 5.5);
    if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 3))
    loopy(30, 5.75);
    if (e.getSource() == ClrBtn)
    rateTermList.setSelectedIndex(0);
    lcdLoanAmt.setText(null);
    lcdMonthlyPmt.setText(null);
    displayArea.setText(null);
    if (e.getSource() == CloseBtn)
    System.exit(0);
    private void loopy(int lTerm,double lInterest)
    double total, monthly, monthlyrate, monthint, monthprin, balance, lastint, paid;
    int amount, months, termloop, monthloop;
    String lcd2 = lcdLoanAmt.getText();
    amount = Integer.parseInt(lcd2);
    termloop = 1;
    paid = 0.00;
    monthlyrate = lInterest / (12 * 100);
    months = lTerm * 12;
    monthly = amount *(monthlyrate/(1-Math.pow(1+monthlyrate,-months)));
    total = months * monthly;
    balance = amount;
    while (termloop <= lTerm)
    displayArea.setCaretPosition(0);
    displayArea.append("\n");
    displayArea.append("Year " + termloop + " of " + lTerm + ": payments\n");
    displayArea.append("\n");
    displayArea.append("Month\tMonthly\tPrinciple\tInterest\tBalance\n");
    monthloop = 1;
    while (monthloop <= 12)
    monthint = balance * monthlyrate;
    monthprin = monthly - monthint;
    balance -= monthprin;
    paid += monthly;
    displayArea.setCaretPosition(0);
    displayArea.append(monthloop + "\t" + calcPattern.format(monthly) + "\t" + calcPattern.format(monthprin) + "\t");
    displayArea.append(calcPattern.format(monthint) + "\t" + calcPattern.format(balance) + "\n");
    monthloop ++;
    termloop ++;
    public static void main(String args[])
    MORT_RETRY f = new MORT_RETRY();
    f.setTitle("MORTGAGE PAYMENT CALCULATOR");
    f.setBounds(600, 600, 500, 500);
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    }need help with displaying the textarea correctly and the scroll bar please.
    Message was edited by:
    new2this2020

    What's the problem you're having ???
    PS.

  • Urgent: im new and need help with this task!

    I need help with converting the pseudo code to java code, Any help will b greatly appreciated!
    // Declare a variable of type int, called "choice".
    // Generate a random number between 0 inclusive and 7
    // exclusive, and store that number into the variable
    // "choice". (How do you generate a random number? Use the
    // nextInt(int) method inside the random object, which takes
    // a single int parameter. You can read about this method
    // here:
    // http://java.sun.com/j2se/1.5.0/docs/api/java/util/Random.html
    // If "choice" is equal to 0, then create and return a new
    // IBlock object, passing "game" as the parameter to IBlock's
    // constructor.
    // Otherwise, if "choice" is equal to 1, then create and
    // return a new TBlock object, passing "game" as the
    // parameter.
    // Otherwise, if "choice" is equal to 2, then create and
    // return a new OBlock object, passing "game" as the
    // parameter.
    // Otherwise, .... etc ....
    // (please continue to do this for all of the 7 kinds of block
    // that can be created)

    import java.util.*;
    public class Echo{
         public static void main(String[] args)     {
              //System.out.println("enter ur choice");
    Random r=new Random();
    int choice=r.nextInt(6);
         switch(choice)
         case 0:
              IBlock object0=new IBlock("games");
              break;
         case 1:
              TBlock object1=new TBlock("games");
              break;
         case 2:
              OBlock object2=new OBlock("games");
              break;
         case 3:
              LBlock object3=new LBlock("games");
              break;
         case 4:
              JBlock object4=new JBlock("games");
              break;
         case 5:
              SBlock object5=new SBlock("games");
              break;
         case 6:
              ZBlock object6=new ZBlock("games");
              break;
    class TBlock
         TBlock(String s)
              System.out.print("TBlock called"+"\n value passed is "+s);
    class IBlock
         IBlock(String s)
              System.out.print("IBlock called"+"\n value passed is "+s);
    class JBlock
         JBlock(String s)
              System.out.print("JBlock called"+"\n value passed is "+s);
    class OBlock
         OBlock(String s)
              System.out.print("OBlock called"+"\n value passed is "+s);
    class LBlock
         LBlock(String s)
              System.out.print("LBlock called"+"\n value passed is "+s);
    class SBlock
         SBlock(String s)
              System.out.print("SBlock called"+"\n value passed is "+s);
    class ZBlock
         ZBlock(String s)
              System.out.print("ZBlock called"+"\n value passed is "+s);
    }

  • Need help with trim and null function

    Hi all,
    I need help with a query. I use the trim function to get the first three characters of a string. How do I write my query so if a null value occurs in combination with my trim to say 'Null' in my results?
    Thanks

    Hi,
    Thanks for the reply. What am I doing wrong?
    SELECT trim(SUBSTR(AL1.user_data_text,1,3)),NVL
    (AL1.user_data_text,'XX')
    FROM Table
    I want the XX to appear in the same column as the
    trim.The main thing you're doing wrong is not formatting your code. The solution may become obvious if you do.
    What you're saying is:
    SELECT  trim ( SUBSTR (AL1.user_data_text, 1, 3))
    ,       NVL ( AL1.user_data_text, 'XX' )
    FROM    Tablewhich makes it clear that you're SELECTing two columns, when you only want to have one.
    If you want that column to be exactly like the first column you're currently SELECTing, except that when that column is NULL you want it to be 'XX', then you have to apply NVL to that column, like this:
    SELECT  NVL ( trim ( SUBSTR (AL1.user_data_text, 1, 3))
                , 'XX'
    FROM    Table

  • Going to Australia and need help with Power converters

    Facts:
    US uses 110v on 60hz
    Australia 220v on 50hz
    Making sure I understood that correctly.  Devices I plan on bringing that will use power are PS3 Slim, MacBook Pro 2008 model, and WD 1TB External HDD.  My DS, and Cell are charging via USB to save trouble of other cables.
    Ideas I've had or thought of:
    1.  Get a power converter for a US Powerstrip, and then plug in my US items into the strip and then the strip into an AUS Converter into Australian outlet.  Not sure if this fixes the voltage/frequency change.
    2.  Get power converters for all my devices.  But, not sure if my devices needs ways of lowering the voltage/increasing frequency or something to help with the adjustment.
    3.  Buy a universal powerstrip, which is extremely costly and I wouldn't be able to have here in time (I leave Thursday).  Unless Best Buy carrys one.  

    godzillafan868 wrote:
    Facts:
    US uses 110v on 60hz
    Australia 220v on 50hz
    Making sure I understood that correctly.  Devices I plan on bringing that will use power are PS3 Slim, MacBook Pro 2008 model, and WD 1TB External HDD.  My DS, and Cell are charging via USB to save trouble of other cables.
    Ideas I've had or thought of:
    1.  Get a power converter for a US Powerstrip, and then plug in my US items into the strip and then the strip into an AUS Converter into Australian outlet.  Not sure if this fixes the voltage/frequency change.
    2.  Get power converters for all my devices.  But, not sure if my devices needs ways of lowering the voltage/increasing frequency or something to help with the adjustment.
    3.  Buy a universal powerstrip, which is extremely costly and I wouldn't be able to have here in time (I leave Thursday).  Unless Best Buy carrys one.  
    Check the specs on input voltage/frequency of your power supplies.
    Many laptop power supplies are "universal/global" and are specced something like 80-265 volts AC 50/60 Hz, but not all.  These will just need a connector adapter.
    Unsure about the PS3 Slim - if it isn't universal it could be difficult as you'll need a 110/220 transformer, one big enough (power-handling wise) for the PS3 will be very bulky.
    For the external WD HDD, if it doesn't have a universal supply, you're probably best off just finding a new wallwart for it that is capable of running on 220/50.
    *disclaimer* I am not now, nor have I ever been, an employee of Best Buy, Geek Squad, nor of any of their affiliate, parent, or subsidiary companies.

  • Need help with INSERT and WITH clause

    I wrote sql statement which correctly work, but how i use this statment with INSERT query? NEED HELP. when i wrote insert i see error "ORA 32034: unsupported use of with clause"
    with t1 as(
    select a.budat,a.monat as period,b.vtweg,
    c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
    c.wrbtr,
    c.matnr,
    c.menge,
    a.monat,
    c.zuonr
    from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
    where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
    and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='D'
    and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
    ,t2 as(
    select a.BUKRS,a.BELNR, a.GJAHR,t1.vtweg,t1.budat,t1.monat from t1, ldw_v1.bkpf a
    where t1.zuonr=a.xblnr and a.blart='WL' and bukrs='8431'
    ,tcogs as (
    select t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
    sum(bseg.wrbtr) as COGS,bseg.matnr,bseg.kunnr,sum(bseg.menge) as QUANTITY
    from t2, ldw_v1.bseg
    where t2.bukrs=bseg.bukrs and t2.belnr=bseg.BELNR and t2.gjahr=bseg.gjahr and BSEG.KOART='S'
    group by t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
    bseg.matnr,bseg.kunnr
    ,t3 as
    select a.budat,a.monat,b.vtweg,
    c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
    case when c.shkzg='S' then c.wrbtr*(-1)
    else c.wrbtr end as NTS,
    c.matnr,c.kunnr,
    c.menge*(-1) as Quantity
    from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
    where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
    and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='S'
    and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
    ,trevenue as (
    select t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,
    sum(t3.NTS) as NTS,t3.matnr,t3.kunnr,sum(t3.QUANTITY) as QUANTITY
    from t3
    group by t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,t3.matnr,t3.kunnr
    select NVL(tr.budat,tc.budat) as budat,
    NVL(tr.monat,tc.monat) as monat,
    NVL(tr.vtweg,tc.vtweg) as vtweg,
    NVL(tr.gjahr, tc.gjahr) as gjahr,
    tr.hkont as NTS_hkont,
    tc.hkont as COGS_hkont,
    NVL(tr.prctr,tc.prctr) as prctr,
    NVL(tr.MATNR, tc.MATNR) as matnr,
    NVL(tr.kunnr, tc.kunnr) as kunnr,
    NVL(tr.Quantity, tc.Quantity) as Quantity,
    tr.NTS as NTS,
    tc.COGS as COGS
    from trevenue TR full outer join tcogs TC
    on TR.BUDAT=TC.BUDAT and TR.MONAT=TC.MONAT and TR.GJAHR=TC.GJAHR
    and TR.MATNR=TC.MATNR and TR.KUNNR=TC.KUNNR and TR.QUANTITY=TC.QUANTITY
    and TR.VTWEG=TC.VTWEG and TR.PRCTR=TC.PRCTR
    Edited by: user13566113 on 25.03.2011 5:26

    Without seeing what you tried it is hard to say what you did wrong, but this is how it would work
    SQL> create table t ( n number );
    Table created.
    SQL> insert into t
      2  with test_data as
      3    (select 1 x from dual union all
      4     select 2 x from dual union all
      5     select 3 x from dual union all
      6     select 4 x from dual)
      7  select x from test_data;
    4 rows created.
    SQL>

  • Just Switched To  Mac's and Need Help With A Few Issues!

    Hi All,
    I finally did it and switched to a Mac!! Never thought it would happen as I always felt guilty about the cost but after 5 laptops crashing on me - well, I just could not take it anymore! I managed to get a fairly good deal on a 15" Macbook Pro - 2.2/120GB version. I still don't know much about the mac way but am trying to learn so any help would be appreciated!
    1). Is there any kind of video tutorial (preferably free!) that I can use that will help me learn the Ma OS X? I have Tiger 10.4.11 on my MBP (Did you hear that - MY MBP!!!)
    2). AOL Assured me that they fully support Mac before I purchased (only 5 times!) but after I had bought it - they then told me that they do not! I got the AOL disk for Mac but it kind of ***** - features are missing etc. Does anyone in the UK run their Mac's with AOL and does it run as per normal? Any advice with AOL & Mac?
    3). AOL also told me - hey, no probs - of course you can transfer all your old emails, favourites folders, personal filing cabinet from a PC to a Mac - but then, after I bought it - the so called dedicated Mac Experts at AOL tell me that simply is not possible - What advice can anyone give me who has switched from PC to Mac with AOL and who needed to transfer all their stuff over? AOL tells you totally different things depending on who you talk to and even from what their web page state! I am really fed up with them!
    4). If I am ever successful in getting all my many years worth of data from AOL on a PC to a Mac, I am really intent of changing ISP's - what are the best ones for Mac that offer good Mac support, good deals and no charges for telephone support?
    5). I was initially happy with Tiger as again, AOL assured me they supported it but not Leopard (even their website says so) and as I stupidly thought that it must be true (we are talking AOL here!). Now I know that they don't support anything Mac, I am contemplating moving to Leopard - I am a little cautious as I heard there were/are many bugs and unhappy leopard experiences - have the majority of these been solved yet and is it advisable to change to Leopard or should I wait until an updated version comes out?
    6). My MBP was originally bought in the US but is registered to my name in the UK. it has 6 months Apple warranty left and I wish to buy Applecare. Apple says it 'recommends' buying Applecare in the country at which the item is registered (not bought, as I understand it). Does that mean, if I buy Applecare in the USA, Apple UK will still accept it and service my MBP as they would do any other or will I have to have the hassle of sending the thing to the USA if it needs attention? Applecare USA T&C's state only for the 50 States & Canada and Applecare UK state only for the UK & EU. Both however state international servicing?! I am a bit confused on this one. I travel a lot and need to know, that any Applecare I buy will not then be limited to just the places they state in the T&C's. As It reads to me, Applecare purchased in the USA/Canada will not cover the UK/Europe/ROTW and vice versa. Is this true or am I missing something or just plain thick?
    5). I really wish to upgrade the 120GB HDD. My understanding is that it must be done by either Apple (who charge really silly money) or if correct, at an "Authorized Apple Service Provider" who of course will be much cheaper. If true, does this mean at ANY authorized apple service provider on the planet or just ones in which the item is registered? If I do the upgrade with a service provider, will Apple then also service the new HDD if something goes wrong as per normal anywhere in the world or will they then say, sorry, will not service the new HDD and you have to go back to the place where you had it installed, even though it was one of their authorized service centers? (that would really suck)!
    6). The spelling and dictionary (and a few other things) are set to US English - how can I set to UK English? I have tried but to no avail so far.
    7) What and how should I set the Firewall settings so I will not get attacks by any form of malware? (I do not know much about this area and what the implications mean)!
    Well, that's it so far - please bear my ignorance, I am so new to Mac's and hope this to be one of the smarter decisions I have made in life! Already I have strange sensation that I never had with all those years of Microsoft & PC's - I kinda feel reassured, safe, that if I have problems, they will get sorted, My life will now be easier and not having to worry so much about crashes, viruses, trojans etc, gives me a sense of liberation and contentment almost - very strange feeling but a **** good one! (if only the women in my life were like that)!
    Thank You All From A PC to Mac Switcher (and NO! I do not feel guilty or scared anymore)!
    SuaveBhav!

    I can help you with your questions about AppleCare, and can also reassure you that both the macbook pro and Leopard will be worth your investment and the time you are putting into figuring out how to get your data across. I switched from windows when I bought my macbook a year and a half ago and would not use any other system now. The other day I completed the transition by erasing parallels and Windows from my system entirely.
    As for AppleCare, you can get warranty care anywhere in the world, no matter where you buy your AppleCare. Mine was bought and is registered in the US, I live in Slovakia, and have had it serviced several times in Austria and Slovakia under the warranty without any problems at all. There are differences, however, in exactly what the warranty covers from place to place, in accordance with the law in each place that AppleCare is issued. Even though I live in the EU, my agreement with Apple is an American one, and the American guarantees hold. If EU law would demand that Apple fix more things, for instance, than American law does, I could not get those things repaired under my agreement, and vice versa.
    Basically, though, I understand my agreement with AppleCare to be that they will fix all problems/damage that are not my fault free of charge for two years after my initial one-year warranty runs out, and that is good enough for me.

  • Need help with links and fill color

    Hi all, I just recently discovered liveCycle and am very impressed with it! I have been trying to make myself a homework calendar for a while now, and I have it done mostly, but there are a few more things I'd like to add that I don't know how to do.
    I have some HTML and Java experience, but very little XML or JavaScript experience. I have a feeling that what I am trying to do is relatively simple, but I just can't figure it out! I have spent hours pouring over Google and the help files, and I feel like I have gotten close, but no joy yet.
    I have attached my calendar so far (truncated to fit 5MB max attachment size). I'd like it to do two more things:
    1. Have the background color of the table cells change from white to green when the check box is checked.
    (Alternately, I'd really like to get rid of the check boxes all thogether and just have the background of the table cells turn green with a keyboard shortcut, like "ctrl + D" for 'done'. But if that isn't possible, then the color change with the check box is fine.)
    2. I'd like the button called 'WORD DOC' in the upper right of the form to open a word document on my local computer. Where I just push that button and a work doc opens right up in Word in another window.
    I was able to get .PDF documents to open up with those other two buttons there ('Big Java' and 'Beginning Java II') by adding the script
    app.openDoc("Big Java.pdf");
    and
    app.openDoc("Beginning Java II.pdf");
    to each of the buttons respectively, but those PDFs need to be in the same folder as the calendar for that to work. I tried just altering that script by replacing the name of the PDF file with the name of a Word doc file like this:
    app.openDoc("test.docx");
    but the button doesn’t work at all, it just does nothing.
    So that’s what I am trying to do. I have spent hours messing around with anything I could think of to get this to work, but unfortunately I just don’t know the language well enough to get it to work.
    I would really appreciate any advice on this at all. Thank you very much for your consideration.

    Hi,
    Thanks very much for your response! I was able to use the code to make the box turn green by adding that script to the 'click' event of textbox and changing the language from FormCalc to JavaScript. So what happened was that when I clicked in the textbox, the color turned green.
    I couln't firgure out how to add it to the checkbox though. When I tried, it didn't do anything. The problem now is that when I click in the textbox to add my homework, it turns green. I need it to turn green once I finish my homework.
    This would work great if the texbox turned green when I SHIFT clicked the box. Is there anything I could add to that scipt to do that?

  • New to Java and need help with this program..please!

    I'd really appreciate any helpful comments about this program assignment that I have to turn in a week from Friday. I'm taking a class one night a week and completely new to Java. I'd ask my professor for help, but we can't call him during the week and he never answers e-mails. He didn't tell us how to call from other classes yet, and I just can't get the darn thing to do what I want it to do!
    The assignment requirements are:
    1. Change a card game application that draws two cards
    and the higher card wins, to a Blackjack application
    2. Include a new class called Hand
    3. The Hand class should record the number of draws
    4. The application should prompt for a number of draws
    5. The game is played against the Dealer
    6. The dealer always draws a card if the dealer's hand total is <= 17
    7. Prompt the player after each hand if he wants to quit
    8. Display the total games won by the dealer and total and the total games wond by the player after each hand
    9. Display all of the dealer's and player's cards at the
    end of each hand
    10. Player has the option of drawing an additional card after the first two cards
    11. The Ace can have a value of 11 or 1
    (Even though it's not called for in the requirements, I would like to be able to let the Ace have a value of 1 or an 11)
    The following is my code with some comments about a few things that are driving me nuts:
    import java.util.*;
    import javax.swing.*;
    import java.text.*;
    public class CardDeck
    public CardDeck()
    deck = new Card[52];
    fill();
    shuffle();
    public void fill()
    int i;
    int j;
    for (i = 1; i <= 13; i++)
    for (j = 1; j <= 4; j++)
    deck[4 * (i - 1) + j - 1] = new Card(i, j);
    cards = 52;
    public void shuffle()
    int next;
    for (next = 0; next < cards - 1; next++)
    int rand = (int)(Math.random()*(next+1));
    Card temp = deck[next];
    deck[next] = deck[rand];
    deck[rand] = temp;
    public final Card draw()
    if (cards == 0)
    return null;
    cards--;
    return deck[cards];
    public int changeValue()
    int val = 0;
    boolean ace = false;
    int cds;
    for (int i = 0; i < cards; i++)
    if (cardValue > 10)
    cardValue = 10;
    if (cardValue ==1)     {
    ace = true;
    val = val + cardValue;
    if ( ace = true && val + 10 <= 21 )
    val = val + 10;
    return val;
    public static void main(String[] args)
    CardDeck d = new CardDeck();
    int x = 3;
    int i;
    int wins = 1;
    int playerTotal = 1;
    do {
    Card dealer = (d.draw());
    /**I've tried everything I can think of to call the ChangeValue() method after I draw the card, but nothing is working for me.**/
    System.out.println("Dealer draws: " + dealer);
    do {
    dealer = (d.draw());
    System.out.println(" " + dealer);
    }while (dealer.rank() <= 17);
    Card mine = d.draw();
    System.out.println("\t\t\t\t Player draws: "
    + mine);
    mine = d.draw();
    System.out.println("\t\t\t\t\t\t" + mine);
    do{
    String input = JOptionPane.showInputDialog
    ("Would you like a card? ");
    if(input.equalsIgnoreCase("yes"))
         mine = d.draw();
    System.out.println("\t\t\t\t\t\t" + mine);
         playerTotal++;
         else if(input.equalsIgnoreCase("no"))
    System.out.println("\t\t\t\t Player stands");
         else
    System.out.println("\t\tInvalid input.
    Please try again.");
    I don't know how to go about making and calling a method or class that will combine the total cards delt to the player and the total cards delt to the dealer. The rank() method only seems to give me the last cards drawn to compare with when I try to do the tests.**/
    if ((dealer.rank() > mine.rank())
    && (dealer.rank() <= 21)
    || (mine.rank() > 21)
    && (dealer.rank() < 22)
    || ((dealer.rank() == 21)
    && (mine.rank() == 21))
    || ((mine.rank() > 21)
    && (dealer.rank() <= 21)))
    System.out.println("Dealer wins");
    wins++;
         else
    System.out.println("I win!");
    break;
    } while (playerTotal <= 1);
    String stop = JOptionPane.showInputDialog
    ("Would you like to play again? ");
    if (stop.equalsIgnoreCase("no"))
    break;
    if (rounds == 5)
    System.out.println("Player wins " +
    (CardDeck.rounds - wins) + "rounds");
    } while (rounds <= 5);
    private Card[] deck;
    private int cards;
    public static int rounds = 1;
    public int cardValue;
    /**When I try to compile this nested class, I get an error message saying I need a brace here and at the end of the program. I don't know if any of this code would work because I've tried adding braces and still can't compile it.**/
    class Hand()
    static int r = 1;
    public Hand() { CardDeck.rounds = r; }
    public int getRounds() { return r++; }
    final class Card
    public static final int ACE = 1;
    public static final int JACK = 11;
    public static final int QUEEN = 12;
    public static final int KING = 13;
    public static final int CLUBS = 1;
    public static final int DIAMONDS = 2;
    public static final int HEARTS = 3;
    public static final int SPADES = 4;
    public Card(int v, int s)
    value = v;
    suit = s;
    public int getValue() { return value; }
    public int getSuit() { return suit;  }
    public int rank()
    if (value == 1)
    return 4 * 13 + suit;
    else
    return 4 * (value - 1) + suit;
    /**This works, but I'm confused. How is this method called? Does it call itself?**/
    public String toString()
    String v;
    String s;
    if (value == ACE)
    v = "Ace";
    else if (value == JACK)
    v = "Jack";
    else if (value == QUEEN)
    v = "Queen";
    else if (value == KING)
    v = "King";
    else
    v = String.valueOf(value);
    if (suit == DIAMONDS)
    s = "Diamonds";
    else if (suit == HEARTS)
    s = "Hearts";
    else if (suit == SPADES)
    s = "Spades";
    else
    s = "Clubs";
    return v + " of " + s;
    private int value; //Value is an integer, so how can a
    private int suit; //string be assigned to an integer?
    }

    Thank you so much for offering to help me with this Jamie! When I tried to call change value using:
    Card dealer = (d.changeValue());
    I get an error message saying:
    Incompatible types found: int
    required: Card
    I had my weekly class last night and the professor cleared up a few things for me, but I've not had time to make all of the necessary changes. I did find out how toString worked, so that's one question out of the way, and he gave us a lot of information for adding another class to generate random numbers.
    Again, thank you so much. I really want to learn this but I'm feeling so stupid right now. Any help you can give me about the above error message would be appreciated.

  • Just coming from Win and need Help with bootcamp/parallels+general osx stuf

    Well I absolutely love my Mac. I'm just having some problems affording it financially, but when I compare this new MacBook Pro to other like computers, there's a very very small difference in the hardware, and Im usually building laptops that are similiar to this for around 2k anyways. So I'm not 100% sure if I'll keep this or not, and maybe settle for cheaper PC that's under 1.5k (because Apple charges you a 10% open box fee) and buy a mac when I'm in a better position, or just keep this and see what I can do.
    But a few of the things that are making me miss a PC might push me toward a cheaper PC. And so maybe someone here can help me out before I make a decision.
    First off, is there anything that's the equivalent to a disk defragmentor for OSX?
    Second, is the graphics card really powerful in this Macbook 15 inch 2.4 ghz (the newest one)
    Im also having a problem with this keyboard and my favorite game. Basically I need to hold down certain keys (control, alt, shift and space) in order to use skills. But for some reason when I hold down any of these buttons, it only reads it once. So I have to push it every time I'd say, want to heal myself or hit a monster... and that might not seem like a lot but if you play a game for 1 hour + (I'd usually play around 4 hours) it's going to absolutely kill my fingers and make playing the game take a lot longer.
    Now I'm using parallels (the only way to play my game) and whenever I try to install a new KB, because I've found out that the way a KB is wired will determine whether or not you can spam a key or not (Like a cheap USB one wont work, but a more expensive logitech one allows you to) but it either
    1) Crashes Parallels and my Win VM
    or
    2) It sets up whatever kb I use to be used with Mac OSX's drivers which means no matter what the KB is, ctrl alt space and shift cant be spammed.
    I'm also unable to use FRAPS, a PC video capturing program used for games while running parallels. My FPS constantly dips to 0 which lags me in the game, and I can't find a good recording program thats OSX side and that works while Parallels is running (I emailed parallels about what vid they used in their demo but no response)
    Now if use bootcamp, will I have nothing to worry about? Will all of the hardware act like it should act natively on a PC? As in will my nVidia graphics card act like it normally would on a PC instead of it being some kind of virtualized hardware or something like on parallels?
    Thanks for the help guys... 2 weeks to decide on whether or not I keep th is laptop....
    Wii code: 2053-8430-7334-7335
    MGO Name: Crim, [BBB]Crim, Pacifist, Kaze, oSoiFong, A NOOB.

    The graphics card is a higher performance GPU than the X1600 in the previous MBP models. As for "really powerful" you don't provide any basis for comparison. Visit the ATI site to find out the specifications for the model.
    Well I understand that much. I just mean as far as a graphics card in general goes, is it strong enough to support a variety of games (both PC and Mac)? This is my first computer without a crappy intergrated graphics card which could barely handle games from the late 1990s.
    As for keyboard shortcuts I'm not sure if you're referring a Mac or a PC game. However, this reference may help. If the game is a Mac version you'll need to contact the game's developer about any problems with how to use the game on a Mac. If you read the Parallels documentation it will explain how to generate any special keyboard characters when in Windows.
    Umm it's not that. Like I first figured out this problem with all electronics in general when I was a kid playing with one of those press and speak books. What I found out was that, let's pretend there were 3 buttons. One was cow going moo, one was a cat meowing and one was a dog barking. If you held down the Cow button and pressed the Cat button, the cow would still Moo. If you held down the Cow and press the dog button, the cow would still moo. However if you pressed and held the cat button, then pressed the cow button the cat would stop meowing, and the moo would override it.
    That same principle applies to keyboards from what I've seen. I know there are some keyboards where I can use the control button and the alt button at the same time, and some keyboard I can't use. I can't blame the game, because there ARE keyboards that work the way I want it to. And I'm not talking about keyboard shortcuts. Pressing Control+Alt isn't a shortcut in a game, just two different commands. Like one is jump, one is attack. In the game you can Jump and Attack with some keyboards, some keyboards only let you jump or attack.
    Another example is if I put my jump key on the letter "a" and if I hold a, I jump over and over until I let go. but if I put jump to my space bar, I jump once then stop. For some reason it won't repeat keys while in a game. Same goes for other buttons, ctrl, shift, and alt.
    Does that make things a little more clear?
    but what I'm going to do is try my mac keyboard on a PC and see if it has the same limitations.
    If Parallels is crashing either you have a faulty installation, your OS X installation is corrupted, or you have not allocated sufficient RAM for the VM. You need at least 2 GBs of installed RAM to use virtualization software and should allocate at least 384 MBs or RAM to Windows XP and 512 MBs to Vista. If you have only 1 GB of RAM installed your system won't be very stable when you try to run Parallels with Windows on 384 or 512 MBs of RAM.
    I have the newest 15 inch which has gigs. And I've tried setting Parallels to both 1 and 512 (windows xp) and I worded the problem wrong. Parallels doesnt crash, parallels runs fine. What happens is Windows XP gets the blue screen of death whenever I try to install a usb device. Since I can't find a logitech keyboard that has drivers/software for a mac, I tried using a Windows one and tried installing it on my XP... and thats when I got the BSOD
    Parallels uses all the native Mac hardware via the virtualization software. No special Mac drivers are required nor special Windows drivers.
    If you cannot run a Windows program in Parallels it's not a problem with OS X. Complain to Parallels.
    It's not that a program isn't running. It's running fine, it's just my FPS gets really low. What I'm trying to figure out is if my graphics card isn't good enough in general, or if it's not good enough to handle parallels and osx and a game with a video capture all at once.
    Boot Camp runs Windows natively on the hardware just as if you were using any other dedicated Windows hardware. "Will I have nothing to worry about?" I don't know. Boot Camp provides the necessary Windows drivers for all currently produced Intel Macs. You can install Windows XP with Service Pak 2 or Vista. Read the Boot Camp documentation to find out more.
    Well I meant will I have nothing to worry about as in, will my graphics card be as effective on my bootcamped win XP as it would be if it was a native XP laptop, or will it be slightly less effective since it was based for a mac intel computer... does that make sense or do I need to reword it?

Maybe you are looking for

  • How can I unlink my iPhone from an apple id?

    I tried to download the iOS 8 update, but it told me i didn't have enough storage and there was an error so i clicked the okay button and unplugged my phone. Then it had that screen that said plug into your iTunes, so i plugged it in and said i had t

  • Oracle SOA Suite 11.1.1.6 10k instances after purging

    Hello, finally I made some steps in purging the Oracle SOA Dehydration store. So I went on and run the soa.delete_instances(...) multiple times in a development env. I was pleased to see everything older then a week getting deleted. But after that th

  • Photos App and images that have no place data

    I am considering moving to the Photos App from iPhoto, but I have a large number of old photos and documents that have no location data. Most were scanned several years ago, such as genealogy records, birth certificates, etc. How does Photos handle t

  • Alternative report to FD10N?

    Hello, I need to display customer balance for special gl transactions for all customers. In FD10N it gives you  cumulative figures.Is there another report where i can view the special GL balances by fiscal period?

  • IPhone 4S bricked after iOS 5.0.1 upgrade

    I just tried to upgrade my iPhone 4S to iOS 5.0.1 with iTunes and I got an error message before it could complete.  Now my phone is not recognized by iTunes and the phone only shows the connect to iTunes logo.  I tried rebooting the phone by holding