Need help with rounding numbers in Java

I finally have this program to where it needs to be except for one thing. The variable "freetime" isn't showing any kind of output in the applet. The variable sum and freetime are both called at the start of the program, and have equations to figure out the output for them, but only sum shows an output. I tried using brackets as opposed to multiple parentheses. What can I do to fix this so that there is an output? I was thinking of using something to round up the result, but I can't figure it out. Can anyone help?
import java.awt.*;
import javax.swing.*;
public class FinalLab extends JApplet{
String firstNum, secondNum, thirdNum, fourthNum, fifthNum;
int personal, family, school, work, sleep, sum, freetime;
public void init()
String firstNum, secondNum, thirdNum, fourthNum, fifthNum;
firstNum = JOptionPane.showInputDialog( "Enter total personal hours." );
secondNum = JOptionPane.showInputDialog( "Enter total family hours." );
thirdNum = JOptionPane.showInputDialog( "Enter total school hours." );
fourthNum = JOptionPane.showInputDialog( "Enter total work hours." );
fifthNum = JOptionPane.showInputDialog( "Enter total sleep hours." );
personal = Integer.parseInt( firstNum );
family = Integer.parseInt( secondNum );
school = Integer.parseInt( thirdNum );
work = Integer.parseInt( fourthNum );
sleep = Integer.parseInt( fifthNum );
sum = (personal + family + school + work + sleep);
freetime = ((168-sum)/168)*100;
public void paint(Graphics g) {
super.paint( g );
g.drawRect( 15, 10, 270, 20 );
g.drawRect( 15, 35, 270, 20 );
g.drawRect( 15, 60, 270, 20 );
g.drawRect( 15, 85, 270, 20 );
g.drawRect( 15, 110, 270, 20 );
g.drawRect( 15, 135, 270, 20 );
g.drawRect( 15, 160, 270, 20 );
g.drawString( "Personal hours: " + personal, 25, 25);
g.drawString( "Family hours: " + family, 25, 50);
g.drawString( "School hours: " + school, 25, 75);
g.drawString( "Work hours: " + work, 25, 100);
g.drawString( "Sleep hours: " + sleep, 25, 125);
g.drawString( "Total hours: " + sum, 25, 150);
g.drawString( "Free time: " + freetime, 25, 175);
}

I am guessing that you really meant that you are seeing "Free time: 0" instead of what you said, which was that it wasn't showing any kind of output. (Your whole terminology is weird, you don't "call a variable" just for example.) If that's the case, it's because you are using integer division. You'll find that 27/168, for example, gives zero. I don't know why you are multiplying by 100 in your calculation and doing the division, perhaps you meant to return the free time as a percentage (in which case your output should say that), but since you are doing that you could do it this way:((168-sum)*100/168)Then you are doing 2700/168, which produces a reasonable number.

Similar Messages

  • Need help with rounding of wage types in IT0008

    Hi,
    We have a requirement to round off wage type 1003 - Monthly Salary in IT0008. The amount entered in this wage type has to be rounded to the nearest 10's for India, 100's for Japan and 1000's for South Korea. For all other countries it should be rounded to the nearest whole number.
    I have tried this by setting up the Rounding Type to A/B/C and Rounding Divisor to 10/100/1000 in the wagetype characteristics table T511 for each of the above scenarios respectively but nothing worked.
    If we cannot find a way to set this up through configuration, we are planning to use the user exit in IT0008 to achieve this functionality. So anay ABAPER's also might pitch in for help...
    This is an existing wage type and we just need to apply rounding this time. Need expert advice pls...
    Thanks,
    Priya

    Actually A/B/C and 10/100/1000 should work but it start rounding off from decimal points. For example if you will put 1000 for round off then it will round off to 10.
    Btw since you are going with user exit, you can do it. What you need to do is read the wage type and indirect valuation module (as indirectly valuated wage type don't give you amount so you need to read module variant and valuate the wage type)  and then write the code for round off.
    Let me know if you need some more clarification on this.

  • Newbie needing help with code numbers and if-else

    I'm 100% new to any kind of programming and in my 4th week of an Intro to Java class. It's also an on-line class so my helpful resources are quite limited. I have spent close to 10 hours on my class project working out P-code and the java code itself, but I'm having some difficulty because the project seems to be much more advanced that the examples in the book that appear to only be partly directly related to this assignment. I have finally come to a point where I am unable to fix the mistakes that still show up. I'm not trying to get anyone to do my assignment for me, I'm only trying to get some help on what I'm missing. I want to learn, not cheat.
    Okay, I have an assignment that, in a nutshell, is a cash register. JOptionPane prompts the user to enter a product code that represents a product with a specific price. Another box asks for the quanity then displays the cost, tax and then the total amount plus tax, formatted in dollars and cents. It then repeats until a sentinel of "999" is entered, and then another box displays the total items sold for the day, amount of merchandise sold, tax charged, and the total amount acquired for the day. If a non-valid code is entered, I should prompt the user to try again.
    I have this down to 6 errors, with one of the errors being the same error 5 times. Here are the errors:
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:50: 'else' without 'if'
    else //if invalid code entered, output message
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:39: unexpected type
    required: variable
    found : value
    100 = 2.98;
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:41: unexpected type
    required: variable
    found : value
    200 = 4.50;
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:43: unexpected type
    required: variable
    found : value
    300 = 6.79;
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:45: unexpected type
    required: variable
    found : value
    400 = 5.29;
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:47: unexpected type
    required: variable
    found : value
    500 = 7.20;
    ^
    And finally, here is my code. Please be gentle with the criticism. I've really put a lot into it and would appreciate any help. Thanks in advance.
    import java.text.NumberFormat; // class for numeric formating from page 178
    import javax.swing.JOptionPane; // class for JOptionOPane
    public class Sales {
    //main method begins execution ofJava Application
    public static void main( String args[] )
    double quantity; // total of items purchased
    double tax; // total of tax
    double value; // total cost of all items before tax
    double total; // total of items including tax
    double totValue; // daily value counter
    double totTax; // daily tax counter
    double totTotal; // daily total amount collected (+tax) counter
    double item; //
    String input; // user-entered value
    String output; // output string
    String itemString; // item code entered by user
    String quantityString; // quantity entered by user
    // initialization phase
    quantity = 0; // initialize counter for items purchased
    // get first code from user
    itemString = JOptionPane.showInputDialog(
    "Enter item code:" );
    // convert itemString to double
    item = Double.parseDouble ( itemString );
    // loop until sentinel value read from user
    while ( item != 999 ) {
    // converting code to amount using if statements
    if ( item == 100 )
    100 = 2.98;
    if ( item == 200 )
    200 = 4.50;
    if ( item == 300 )
    300 = 6.79;
    if ( item == 400 )
    400 = 5.29;
    if ( item == 500 )
    500 = 7.20;
    else //if invalid code entered, output message
    JOptionPane.showMessageDialog( null, "Invalid code entered, please try again!",
    "Item Code", JOptionPane.INFORMATION_MESSAGE );
    } // end if
    } // end while
    // get quantity of item user
    itemString = JOptionPane.showInputDialog(
    "Enter quantity:" );
    // convert quantityString to int
    quantity = Double.parseDouble ( quantityString );
    // add quantity to quantity
    quantity = quantity + quantity;
    // calculation time! value
    value = quantity * item;
    // calc tax
    tax = value * .07;
    // calc total
    total = tax + value;
    //add totals to counter
    totValue = totValue + value;
    totTax = totTax + tax;
    totTotal = totTotal + total;
    // display the results of purchase
    JOptionPane.showMessageDialog( null, "Amount: " + value +
    "\nTax: " + tax + "\nTotal: " + total, "Sale", JOptionPane.INFORMATION_MESSAGE );
    // get next code from user
    itemString = JOptionPane.showInputDialog(
    "Enter item code:" );
    // If sentinel value reached
    if ( item == 999 ) {
    // display the daily totals
    JOptionPane.showMessageDialog( null, "Total amount of items sold today: " + quantity +
    "\nValue of ites sold today: " + totValue + "\nTotal tax collected today: " + totTax +
    "\nTotal Amount collected today: " + totTotal, "Totals", JOptionPane.INFORMATION_MESSAGE );
    System.exit( 0 ); // terminate application
    } // end sentinel
    } // end message
    } // end class Sales

    Here you go. I haven't tested this but it does compile. I've put in a 'few helpful hints'.
    import java.text.NumberFormat; // class for numeric formating from page 178
    import javax.swing.JOptionPane; // class for JOptionOPane
    public class TestTextFind {
    //main method begins execution ofJava Application
    public static void main( String args[] )
         double quantity; // total of items purchased
         double tax; // total of tax
         double value; // total cost of all items before tax
         double total; // total of items including tax
    //     double totValue; // daily value counter
    //     double totTax; // daily tax counter
    //     double totTotal; // daily total amount collected (+tax) counter
    // Always initialise your numbers unless you have a good reason not too
         double totValue = 0; // daily value counter
         double totTax = 0; // daily tax counter
         double totTotal = 0; // daily total amount collected (+tax) counter
         double itemCode;
         double item = 0;
         String itemCodeString; // item code entered by user
         String quantityString; // quantity entered by user
         // initialization phase
         quantity = 0; // initialize counter for items purchased
         // get first code from user
         itemCodeString = JOptionPane.showInputDialog("Enter item code:" );
         // convert itemString to double
         itemCode = Double.parseDouble ( itemCodeString );
         // loop until sentinel value read from user
         while ( itemCode != 999 ) {
    * 1. variable item mightnot have been initialised
    * You had item and itemCode the wrong way round.
    * You are supposed to be checking itemCode but setting the value
    * for item
              // converting code to amount using if statements
              if ( item == 100 )
              {itemCode = 2.98;}
              else if ( item == 200 )
              {itemCode = 4.50;}
              else if ( item == 300 )
              {itemCode = 6.79;}
              else if ( item == 400 )
              {itemCode = 5.29;}
              else if ( item == 500 )
              {itemCode = 7.20;}
              else {//if invalid code entered, output message
                   JOptionPane.showMessageDialog( null, "Invalid code entered, please try again!",
                   "Item Code", JOptionPane.INFORMATION_MESSAGE );
              } // end if
         } // end while
         // get quantity of item user
         itemCodeString = JOptionPane.showInputDialog("Enter quantity:" );
    * 2.
    * You have declared quantityString here but you never give it a value.
    * I think this should be itemCodeString shouldnt it???
    * Or should you change itemCodeString above to quantityString?
         // convert quantityString to int
    //     quantity = Double.parseDouble ( quantityString );  // old code
         quantity = Double.parseDouble ( itemCodeString );
         // add quantity to quantity
         quantity = quantity + quantity;
         // calculation time! value
         value = quantity * itemCode;
         // calc tax
         tax = value * .07;
         // calc total
         total = tax + value;
         //add totals to counter
    * 3. 4. and 5.
    * With the following you have not assigned the 'total' variables a value
    * so in effect you are saying eg. "total = null + 10". Thats why an error is
    * raised.  If you look at your declaration i have assigned them an initial
    * value of 0.
         totValue = totValue + value;
         totTax = totTax + tax;
         totTotal = totTotal + total;
         // display the results of purchase
         JOptionPane.showMessageDialog( null, "Amount: " + value +
         "\nTax: " + tax + "\nTotal: " + total, "Sale", JOptionPane.INFORMATION_MESSAGE );
         // get next code from user
         itemCodeString = JOptionPane.showInputDialog("Enter item code:" );
         // If sentinel value reached
         if ( itemCode == 999 ) {
              // display the daily totals
              JOptionPane.showMessageDialog( null, "Total amount of items sold today: " + quantity +
              "\nValue of ites sold today: " + totValue + "\nTotal tax collected today: " + totTax +
              "\nTotal Amount collected today: " + totTotal, "Totals",           JOptionPane.INFORMATION_MESSAGE );
              System.exit( 0 ); // terminate application
         } // end sentinel
    } // end message
    } // end class SalesRob.

  • Need help with Rounding a number.

    I have 3 cells each with a formula in them. Please bear with me while I try to explain this.
    Cell D18 contains the formula: =Sum(L18/C5) (L18's value is 58, C5's value is 10), So the value of the cell is 5.8. I need this number to round properly to 6. It does visually on the spreadsheet.
    Cell F18 contains the formula: =Sum(E18/F5) (E18=28, F5=8) So the actual value of F18 is 3.5 which is rounded to 4 visually on the spreadsheet.
    Cell G18 contains the formula =Sum(D18+F18). (D18 visually displays 6, F18 visually displays 4, therefore G18 should display 10). G18 actually displays 9. For some reason the calculations are still based on the actual calculations of D18 & F18, instead of the rounded displayed numbers. How do I get G18 to display the correct number of 10, rather than the rounded down number of 9?
    I'm sure there's a simple fix that I'm just not understanding. I hope I explained my problem well enough, I'd appreciate any help I can get. These numbers are to calculate insulin dosage, so I need to be sure the math is correct.
    Thanks in advance for any help!

    yvieinca wrote:
    I have 3 cells each with a formula in them. Please bear with me while I try to explain this.
    Cell D18 contains the formula: =Sum(L18/C5) (L18's value is 58, C5's value is 10), So the value of the cell is 5.8. I need this number to round properly to 6. It does visually on the spreadsheet.
    Cell F18 contains the formula: =Sum(E18/F5) (E18=28, F5=8) So the actual value of F18 is 3.5 which is rounded to 4 visually on the spreadsheet.
    Cell G18 contains the formula =Sum(D18+F18). (D18 visually displays 6, F18 visually displays 4, therefore G18 should display 10). G18 actually displays 9. For some reason the calculations are still based on the actual calculations of D18 & F18, instead of the rounded displayed numbers. How do I get G18 to display the correct number of 10, rather than the rounded down number of 9?
    The explanation is that you don't understand what you are doing.
    When you ask numbers to display 0 decimal, you don't ask it to round the contents but to display the rounded value.
    A contents remains 3.6 but the display is 4
    an other contents may be 3.6 too displaying 4
    When you sum, you ask number to add the contents (3.6 + 3.6) which is 7.2 and you ask it to display the rounded value of this result. So you correctly see 7 not 8.
    If you want to get what you described, you MUST force Numbers to round.
    First,I don't understand how you may invent such a silly thing like =Sum(L8/C5)
    You are asking Numbers to sum the result of the division L8/C5 to nothing.
    The correct syntax would ask it to calculate the quotient, no less no more.
    =L8/C5
    but here we need to round so, in D18, enter
    =ROUND(L8/C5,0)
    in F18, enter
    =ROUND(E8/F5,0)
    In G18, =Sum(D18+F18) is silly too.
    You are asking nummber to sum (D18+F18) and nothing.
    The correct formula may be:
    =SUM(D18,F18)
    or
    =D18+F18
    Yvan KOENIG (from FRANCE samedi 13 juin 2009 18:05:33)

  • Need help with rounding up a number

    In my codes, there is a loop and when I cfdump the value, it
    looks like this:
    2.0,.3.0,4.0, all the way to 32.0, etc
    I need to use these number in a For Loop from="1"
    to="#ThisNumber#" but first I need to round it up so ThisNumber
    will come out as a whole number and not with the dot zero
    Is there a function in CF that can do this? Please help!

    alecken wrote:
    > In my codes, there is a loop and when I cfdump the
    value, it looks like this:
    > 2.0,.3.0,4.0, all the way to 32.0, etc
    > I need to use these number in a For Loop from="1"
    to="#ThisNumber#" but first
    > I need to round it up so ThisNumber will come out as a
    whole number and not
    > with the dot zero
    > Is there a function in CF that can do this? Please help!
    >
    A quick glance at the documentation for mathmetical functions
    turns up
    int(), floor() and ceiling() depending on how you would like
    to round
    different types of numbers.

  • Need help with formating numbers

    public void returnDollars()
              double dollar;
              dollar=amountr-amount;
    NumberFormat fmt = NumberFormat.getNumberInstance();
              System.out.println(fmt.fomat(dollar));
    there is my code.....now lets say
    amountr = 10
    amount 8.5
    now when i print my dollar amount i want it to show up as 1 not 1.5 or 2. So in other words format it with no decimals and not round up at the same time.
    Help would be appriciated...thanks

    well...after 8 hours of trying to get it working i did it.....here it is ...........I'm sure there are many ways to make it smaller.
    import java.text.*;
    import java.io.*;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;
    public class Cashier
    double amount;
    double amountr;
    double dollar;
    double amountleft;
    double quaters;
    double test;
    double dimes;
    double pennies;
    public void getAmount()throws IOException
         BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
              System.out.println("Please enter amount due:");
              String input = console.readLine();
         amount = Double.parseDouble(input);
    System.out.println("Amount due = " + amount);
         public void recieve()throws IOException
    BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
              System.out.println("Please enter amount recieved :");
              String input = console.readLine();
         amountr = Double.parseDouble(input);
    System.out.println("Amount recieved = " + amountr);
         public void returnDollars()throws IOException
              double check = amountr-amount;
              dollar=amountr-amount;
    DecimalFormat fmt = new DecimalFormat("##");
    String s = fmt.format((double)(long)dollar);
    double d = Double.valueOf(s).doubleValue();
    amountleft=check-d;
         System.out.println("Dollars to return " + s);
    public void returnQuaters()
         quaters= amountleft/.25;
         double check = quaters;
    DecimalFormat fmt = new DecimalFormat("##");
    String s = fmt.format((double)(long)quaters);
    double d = Double.valueOf(s).doubleValue();
    fmt.setMaximumFractionDigits(2);
    String dol = fmt.format(amountleft);
              //System.out.println(dol);
              double e =Double.valueOf(dol).doubleValue();
    e= e-2*(.25);
    amountleft=e;
         System.out.println("Quaters to return: " + s);
         public void returnDimes()
         dimes= amountleft/.1;
         double check = dimes;
    DecimalFormat fmt = new DecimalFormat("##");
    String s = fmt.format((double)(long)dimes);
    System.out.println("Dimes to return: " + s);
    double d = Double.valueOf(s).doubleValue();
    fmt.setMaximumFractionDigits(2);
    String dol = fmt.format(amountleft);
              double e =Double.valueOf(dol).doubleValue();
    e= e-1*(.1);
    fmt.setMaximumFractionDigits(2);
    String dola = fmt.format(e);
              double t =Double.valueOf(dola).doubleValue();
    amountleft=t;
              public void returnNickles()
         double nickles = amountleft/.05;
              double check = nickles;
    DecimalFormat fmt = new DecimalFormat("##");
    String s = fmt.format((double)(long)nickles);
    System.out.println("Niclkles to return: " + s);
    double d = Double.valueOf(s).doubleValue();
    fmt.setMaximumFractionDigits(2);
    String dol = fmt.format(amountleft);
              double e =Double.valueOf(dol).doubleValue();
    e= e-1*(.05);
    fmt.setMaximumFractionDigits(2);
    String dola = fmt.format(e);
              double t =Double.valueOf(dola).doubleValue();
    amountleft=t;
         public void returnPennies()
              double pennies = amountleft/.01;
    DecimalFormat fmt = new DecimalFormat("##");
    String s = fmt.format((double)(long)pennies);
    System.out.println("Pennies to return: " + s);
         public static void main(String[] a) throws IOException
              Cashier cash = new Cashier();
              cash.getAmount();
              cash.recieve();
              cash.returnDollars();
              cash.returnQuaters();
              cash.returnDimes();
              cash.returnNickles();
              cash.returnPennies();

  • Need help with random numbers

    hi i need to generate 2 random numbers from array list . and then take out that two numbers from list.
         String[] plcard = { "AC", "KC", "QC", "JC",
              "10C", "9C", "8C", "7C","6C","5C","4C","3C","2C", "AD", "KD", "QD", "JD",
              "10D", "9D", "8D", "7D","6D","5D","4D","3D","2D", "AS", "KS", "QS", "JS",
              "10S", "9S", "8S", "7S","6S","5S","4S","3S","2S", "AH", "KH", "QH", "JH",
              "10H", "9H", "8H", "7H","6H","5H","4H","3H","2H",};
    this is the list if someone can help me i would appreciate
    thanks in advance

    haha, never noticed the .shuffle(List) method!
    maybe java is getting too convenient (just kidding)?
    i never wrote a card game.
    how would the more programmingly gifted of us do this?
    this is my shot at it for what its worth...
    public class Card{
    public Card(int rank, int suit){
    this.rank = rank;
    this.suit = suit;
    int rank (or String i suppose)
    int suit;
    static final club = 1;
    static final spade = 2;
    static final heart = 3;
    static final diamond = 4;
    public class Shuffler{
    public Shuffler(){
    int NumOfDecks = 1;
    Vector ShuffledDeck;
    // num of decks
    for(int i = 0; i < NumOfDecks){
    // 4 suits
    for(int j = 0; j < 4; j++){
    // 13 ranks
    for(int k = 0; k < 13; k++){
    ShuffledDeck.add(new Card(k, j));
    } // suits
    } // num of decks
    Collections.shuffle(ShuffledDeck);
    // Done?
    }

  • I need help with copying files in java?

    hi, i use the following code sample to copy a directory structure and its files.
    It copy's the directory-structure, but all the files in it have 0kb as size. except one file.
    Here's the code:
    public static void copyDir(String source, String target)
    String [] listing = new String [0];
    FileReader in = null;
    FileWriter out = null;
    String sourcePath = source;
    String targetPath = target;
    // Maakt directory onder target directory
    File f = new File(targetPath);
    f.mkdir();
    // Maakt filelist van bestanden in source-directory
    f = new File(sourcePath);
    listing = f.list();
    for(int i = 0; i < listing.length; i++)
    f = new File(sourcePath + listing);
    if(f.isDirectory())
    copyDir(source + listing[i] + File.separatorChar,
    target + listing[i] + File.separatorChar);
    else
    try
    in = new FileReader(sourcePath + listing[i]);
    out = new FileWriter(targetPath + listing[i]);
    int t;
    while (-1 != (t = in.read()))
    out.write(t);
    try { Thread.sleep(200); } catch (InterruptedException e) { }
    System.out.println("Copied: " + sourcePath + listing[i]);
    catch (Exception e)
    System.out.println(e);

    Here is a quick copy program that works. You'll need to deal with the exception instead of just throwing it though.
    import java.io.*;
    public class Copy
      private static void copy(String source, String target) throws IOException
        // Create directory
        File file=new File(target);
        file.mkdirs();
        // Get contents
        file=new File(source);
        File[] files=file.listFiles();
        // Copy files
        int length;
        byte[] buffer=new byte[1024];
        for(int i=0; i<files.length; i++)
          String destination=target+File.separator+files[ i ].getName();
          if(files[ i ].isDirectory())
            copy(files[ i ].getPath(), destination);
          else
            FileInputStream in=new FileInputStream(files[ i ]);
            FileOutputStream out=new FileOutputStream(destination);
            while((length=in.read(buffer))!=-1)
              out.write(buffer, 0, length);
            in.close();
            out.close();
      public static void main(String[] args) throws IOException
        copy(args[0], args[1]);
    }[\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need help with skype numbers....urgent please!

    Question regarding skype numbers..... So i plan to buy hongkong skype number,......say for example + 852 8192 6362, and if im right , i can receive the calls on my PC /desktop, etc. But what about if im traveling , for few days to mainland china or london , will my family still be able to call the same number with appropriate county code, n will i continue to recive calls on my PC. { *Example calling me in china +8621 8192 6362 } In short, can my family call my anywhere in the world by using proper country codes, or is skype number limited to hongkong only, I travel alot, and cant change numbers frequently. Thanks....

    Hi, ajamal786, and welcome to the Community,
    Yes, your one Skype Number travels with your account regardless of wherever you are.  Such is the beauty of a Skype Number: people can call you on the number you set up, which in theory would be a local call to them depending upon the availability of numbers from which you can choose (my Skype Number exchange is a few townships away, but still a local call), and reach you on Skype.
    So, no need to change a Skype Number.
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • Need Help with random numbers, please help

    Hi guys;
    I need your help for a school project. I need to generate a random number from 1.0 to 2.0. How would I do that?
    Regards,

    http://java.sun.com/j2se/1.3/docs/api/java/util/Random.html#nextFloat()

  • Need help with ABAP coding using java

    Dear experts,
    I have used ABAP to code many reports/function modules.However as i know java quite well,i want to achieve the same using java.I have utilized JCO to retrieve information from RFC in this mission.
    However i realized that i had to code all things using ABAP and use java only as interface to connect to
    SAP fetch that module and display information on console.It was not that fun.
    I want that i should not Login to SAP but work only using java.
    I heard SAP Netweaver is a good choice.But i dont know much about it.Will i be able to develop reports only by java and how ?
    Plz suggest.

    hi,
    I hope that you already have the J2ME Toolkit and that your emulator works okay. In the toolkit you get several examples to show you how to program a MIDlet. One has to do with a HTTP client server connection. Also in the API documentation for the J2ME there is a Connector class that you used to set up this communication and in the description of this class it pretty thoroughly explains how to set up an HTTP protocol client.
    However, if you want to do some other kind of networking then you are pretty much out of luck, as the TCPIP socket protocol has not been fully implemented and is optional to the J2ME specifications, only the HTTP protocol is certain to be available. This means that mobile phone companies can add other networking functionality to their phone's java virtual machine if they feel like it. This is a bummer I know.
    I hope this helps.
    Cheers,
    Mark

  • Need help with Socket prog using Java wireless toolkit

    Hi, I am not able to communicate between client (Palm emulator) and server (Java on computer) using Java Wireless toolkit.
    Can anyone please tell me a site that shows an example. I have seen a bunch of examples but they all run by importing com.sun.kjava which seems to have vanished into thin air. So I cannot run them. Someone please show me some lines of code that will send just one character from client Palm emulator to server. thanks.
    Syed

    hi,
    I hope that you already have the J2ME Toolkit and that your emulator works okay. In the toolkit you get several examples to show you how to program a MIDlet. One has to do with a HTTP client server connection. Also in the API documentation for the J2ME there is a Connector class that you used to set up this communication and in the description of this class it pretty thoroughly explains how to set up an HTTP protocol client.
    However, if you want to do some other kind of networking then you are pretty much out of luck, as the TCPIP socket protocol has not been fully implemented and is optional to the J2ME specifications, only the HTTP protocol is certain to be available. This means that mobile phone companies can add other networking functionality to their phone's java virtual machine if they feel like it. This is a bummer I know.
    I hope this helps.
    Cheers,
    Mark

  • I need help with File Object in Java

    Hello Experts.
    I am learning Java 2 now. I have trouble with reading a JTextField and save it to a file. I have some errors that I dont know what they are. I would like someone please help me to write a short sample program to see how it work. The code from the book I have dont execute at all. And I want to use FileOutputStream and ObjectOutputStream. Thank you very much
    Quoc

    import java.io.*;
    public class FileTest {
      public static void main(String[] arg) throws Exception{
        FileOutputStream fileOut = new FileOutputStream("test.txt");
        fileOut.write("Test file".getBytes());
        fileOut.close();

  • I need help with the numbering pages in a book file

    I have a 53 chapter book that which each chapter is its own document. It used to work great. The page numbers of each document used to continue from the last page number of the previous document. That was until today when I opened it and all the page numbers now start at one. I don't know what to do. I have checked all of the options I knew to check. Each document still has the 'automatic page numbering' option selected. I truly don't want to have to go through and manully renumber every document. It will take time I do not have. If I can get somebody's help, it would be wonderful.

    Nor do I. It sounds like everything is set correctly. You might want to try creating a new Book file and add the individaul documents into it and see if that fixes things. Also, have you tried updating the numberingfrom the menu since this started?

  • Need help with game program in java

    Ok this is my first post and I have no idea what I'm doing for this assignment. Basically I have to construct a game with two subclasses for the player class. These two subclasses have to be able to perform different methods and act from what i understand opposite of each other. If I can get help on how to start it and how I should go about this would be great.
    The actual directions and code that I have so far is on the links below.
    Thanks again.
    directions
    Assignment

    Create a class caller Player. Then create two different classes that inherit from player. One called Team1Player and the other called Team2Player. To the Player class, add firstName and lastName varaibles. Add setFirstName,setLastName, getFirstName,getLastName (both team1 and team2 players have first and last names, therefore it goes into the base class 'Player'). Any other functions common to both player1 and player1 goes also into the Player class so they are inherited. Functions unique to player 1 or player 2 goes into those classes respectfully. The rest of your assignment is up to you to code. If you don't understand something, try to skip over it and come back to it later. Developers often rewrite their code over and over as they realize more requirements (better developers beat the requirements out of the customer first ;)

Maybe you are looking for

  • Problem in forms 6i

    here is the code i am using to call a report from forms. the reports works fine in cleint server mode but fails in web enviornment. the errorr i am getting in web enviornment i have given below. can somebody help me to find out where the problem is l

  • Drag and Drop Items

    Dear all APEX developers, i have a problem when rearranging items in the drag and drop layout and press next i get the following error: report error: ORA-29262: bad URL anyone can help? Best Regards Ahmed

  • Cash vouchers

    Hi all experts, I have received object to develop cash vouchers in FI module objects should develop in smartform are as follows... [1] Petty Cash Voucher [2] Purchase Voucher [3] Journal Voucher [4] Expense Voucher I have no idea about FI module and

  • Custom tag cloud webpart based on keywords from a Term Set in the Term Store .

    Hi Guys Does anyone have developed a custom Tag Cloud webpart in SharePoint 2010? I'm looking for a custom Tag cloud based on keywords from a Term Set in the Term Store. Unfortunately out of the box Tag Cloud Web Part only reference the Social Tags f

  • FCP Projects in San

    Is anyone working with FCP projects on the San? Opening them over a afp share, if so how are you finding it? Or is the typical workflow, copy the project to a local drive and then copy back and never working directly on the san.