Need Help in calculation of Running inventory

Hi Team,
I have requirement below,
_*Input*_
Pck     TotInv     Qty 1     Qtry 2     Qty 3
Pck 1     10000      0      0      0
Pck 2     0     50     30     100
_*ouput*_
Pck     TotInv     Qty 1     Qtry 2     Qty 3
Pck 1     10000     9950     9920     9820
Pck 2     0     50     30     100
The following logic is used
Qty 1 for Pck 1 = Tot Inv - Qty 1 from PCK2
Qty 2 for Pck 1 = Qty 1 from PCK1 - Qty from PCK 2
Qty 3 for Pck 1 = Qtry 2 for Pck 1 - Qty 3 from PCK 2
Kindly assist me here, i hope i am clear in my explanation,
Regards
nic

Hi,
Thanks for this assistance,
but this is not working
SQL>
SQL> Create Table t As
  2  (
  3  select 'Pck 1' Pck, 10000 TotInv,  0 Qty_1,  0 Qty_2, 0 Qty_3 From dual Union All
  4   Select 'Pck 2'          ,   0          ,   50       ,  30         , 100     From dual
  5   );
SQL>
SQL> select *
  2  from t
  3  model
  4  dimension by(pck)
  5  measures(TotInv,Qty_1,Qty_2,Qty_3)
  6  (
  7  Qty_1[1]=TotInv[1]-Qty_1[2],
  8  Qty_2[1]=Qty_1[1]-Qty_2[2],
  9  Qty_3[1]=Qty_2[1]-Qty_3[2]);
PCK       TOTINV      QTY_1      QTY_2      QTY_3
Pck 1      10000          0          0          0
Pck 2          0         50         30        100
1                                     

Similar Messages

  • Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset pref

    Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset preferences and still have problem. Slow to open and in force quit "Photoshop not responding" At this point should I uninstall and start over.

    What are the performance Preferences?

  • Hi I am new on the Mac, I need help, how can I run my apps from my library on my Mac Pro?  All my apps I was used in my iPad, thanks guys!!!!

    Hi I am new on the Mac, I need help, how can I run my apps from my library on my Mac Pro?  All my apps I was used in my iPad, thanks guys!!!!

    The Mac OS X and iOS versions are separate products

  • Need help with calculator project for an assignment...

    Hi all, I please need help with my calculator project that I have to do for an assignment.
    Here is the project's specifications that I need to do"
    """Create a console calculator applicaion that:
    * Takes one command line argument: your name and surname. When the
    program starts, display the date and time with a welcome message for the
    user.
    * Display all the available options to the user. Your calculator must include
    the arithmetic operations as well as at least five scientific operations of the
    Math class.
    -Your program must also have the ability to round a number and
    truncate it.
    -When you multiply by 2, you should not use the '*' operator to perform the
    operation.
    -Your program must also be able to reverse the sign of a number.
    * Include sufficient error checking in your program to ensure that the user
    only enters valid input. Make use of the String; Character, and other
    wrapper classes to help you.
    * Your program must be able to do conversions between decimal, octal and
    hex numbers.
    * Make use of a menu. You should give the user the option to end the
    program when entering a certain option.
    * When the program exits, display a message for the user, stating the
    current time, and calculate and display how long the user used your
    program.
    * Make use of helper classes where possible.
    * Use the SDK to run your program."""
    When the program starts, it asks the user for his/her name and surname. I got the program to ask the user again and again for his/her name and surname
    when he/she doesn't insert anything or just press 'enter', but if the user enters a number for the name and surname part, the program continues.
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??
    Here is the programs code that I've written so far:
    {code}
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Project {
         private static String nameSurname = "";     
         private static String num1 = null;
         private static String num2 = null;
         private static String choice1 = null;
         private static double answer = 0;
         private static String more;
         public double Add() {
              answer = (Double.parseDouble(num1) + Double.parseDouble(num2));
              return answer;
         public double Subtract() {
              answer = (Double.parseDouble(num1) - Double.parseDouble(num2));
              return answer;
         public double Multiply() {
              answer = (Double.parseDouble(num1) * Double.parseDouble(num2));
              return answer;
         public double Divide() {
              answer = (Double.parseDouble(num1) / Double.parseDouble(num2));
              return answer;
         public double Modulus() {
              answer = (Double.parseDouble(num1) % Double.parseDouble(num2));
              return answer;
         public double maximumValue() {
              answer = (Math.max(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double minimumValue() {
              answer = (Math.min(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double absoluteNumber1() {
              answer = (Math.abs(Double.parseDouble(num1)));
              return answer;
         public double absoluteNumber2() {
              answer = (Math.abs(Double.parseDouble(num2)));
              return answer;
         public double Squareroot1() {
              answer = (Math.sqrt(Double.parseDouble(num1)));
              return answer;
         public double Squareroot2() {
              answer = (Math.sqrt(Double.parseDouble(num2)));
              return answer;
         public static String octalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
    String octal1 = Integer.toOctalString(iNum1);
    return octal1;
         public static String octalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String octal2 = Integer.toOctalString(iNum2);
              return octal2;
         public static String hexadecimalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
              String hex1 = Integer.toHexString(iNum1);
              return hex1;
         public static String hexadecimalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String hex2 = Integer.toHexString(iNum2);
              return hex2;
         public double Round1() {
              answer = Math.round(Double.parseDouble(num1));
              return answer;
         public double Round2() {
              answer = Math.round(Double.parseDouble(num2));
              return answer;
              SimpleDateFormat format1 = new SimpleDateFormat("EEEE, dd MMMM yyyy");
         Date now = new Date();
         SimpleDateFormat format2 = new SimpleDateFormat("hh:mm a");
         static Date timeIn = new Date();
         public static long programRuntime() {
              Date timeInD = timeIn;
              long timeOutD = System.currentTimeMillis();
              long msec = timeOutD - timeInD.getTime();
              float timeHours = msec / 1000;
                   return (long) timeHours;
         DecimalFormat decimals = new DecimalFormat("#0.00");
         public String insertNameAndSurname() throws IOException{
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        while (nameSurname == null || nameSurname.length() == 0) {
                             for (int i = 0; i < nameSurname.length(); i++) {
                             if ((nameSurname.charAt(i) > 'a') && (nameSurname.charAt(i) < 'Z')){
                                       inputCorrect = true;
                        else{
                        inputCorrect = false;
                        break;
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your name and surname: ");
                             nameSurname = inStream.readLine();
                             inputCorrect = true;
                        }catch (IOException ex) {
                             System.out.println("You did not enter your name and surname, " + nameSurname + " is not a name, please enter your name and surname :");
                             inputCorrect = false;
                        System.out.println("\nA warm welcome " + nameSurname + " ,todays date is: " + format1.format(now));
                        System.out.println("and the time is now exactly " + format2.format(timeIn) + ".");
                        return nameSurname;
              public String inputNumber1() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter a number you want to do a calculation with and hit <ENTER>: ");
                             num1 = br.readLine();
                             double number1 = Double.parseDouble(num1);
                             System.out.println("\nThe number you have entered is: " + number1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("\nYou did not enter a valid number: " + "\""+ num1 + "\" is not a number!!");
                             inputCorrect = false;
                        return num1;
         public String calculatorChoice() throws IOException {
              System.out.println("Please select an option of what you would like to do with this number from the menu below and hit <ENTER>: ");
              System.out.println("\n*********************************************");
              System.out.println("---------------------------------------------");
              System.out.println("Please select an option from the list below: ");
              System.out.println("---------------------------------------------");
              System.out.println("1 - Add");
              System.out.println("2 - Subtract");
              System.out.println("3 - Multiply");
              System.out.println("4 - Divide (remainder included)");
              System.out.println("5 - Maximum and minimum value of two numbers");
              System.out.println("6 - Squareroot");
              System.out.println("7 - Absolute value of numbers");
              System.out.println("8 - Octal and Hexadecimal equivalent of numbers");
              System.out.println("9 - Round numbers");
              System.out.println("0 - Exit program");
              System.out.println("**********************************************");
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your option and hit <ENTER>: ");
                             choice1 = inStream.readLine();
                             int c1 = Integer.parseInt(choice1);
                             System.out.println("\nYou have entered choice number: " + c1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid choice number: " + "\""+ choice1 + "\" is not in the list!!");
                             inputCorrect = false;
                        return choice1;
         public String inputNumber2() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br2 = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter another number you want to do the calculation with and hit <ENTER>: ");
                             num2 = br2.readLine();
                             double n2 = Double.parseDouble(num2);
                             System.out.println("\nThe second number you have entered is: " + n2);
                             System.out.println("\nYour numbers are: " + num1 + " and " + num2);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid number: " + "\""+ num2 + "\" is not a number!!");
                             inputCorrect = false;
                        return num2;
         public int Calculator() {
              int choice2 = (int) Double.parseDouble(choice1);
              switch (choice2) {
                        case 1 :
                             Add();
                             System.out.print("The answer of " + num1 + " + " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 2 :
                             Subtract();
                             System.out.print("The answer of " + num1 + " - " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 3 :
                             Multiply();
                             System.out.print("The answer of " + num1 + " * " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 4 :
                             Divide();
                             System.out.print("The answer of " + num1 + " / " + num2 + " is: " + decimals.format(answer));
                             Modulus();
                             System.out.print(" and the remainder is " + decimals.format(answer));
                             break;
                        case 5 :
                             maximumValue();
                             System.out.println("The maximum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             minimumValue();
                             System.out.println("The minimum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 6 :
                             Squareroot1();
                             System.out.println("The squareroot of value " + num1 + " is: " + decimals.format(answer));
                             Squareroot2();
                             System.out.println("The squareroot of value " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 7 :
                             absoluteNumber1();
                             System.out.println("The absolute number of " + num1 + " is: " + decimals.format(answer));
                             absoluteNumber2();
                             System.out.println("The absolute number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 8 :
                             octalEquivalent1();
                             System.out.println("The octal equivalent of " + num1 + " is: " + octalEquivalent1());
                             octalEquivalent2();
                             System.out.println("The octal equivalent of " + num2 + " is: " + octalEquivalent2());
                             hexadecimalEquivalent1();
                             System.out.println("\nThe hexadecimal equivalent of " + num1 + " is: " + hexadecimalEquivalent1());
                             hexadecimalEquivalent2();
                             System.out.println("The hexadecimal equivalent of " + num2 + " is: " + hexadecimalEquivalent2());
                             break;
                        case 9 :
                             Round1();
                             System.out.println("The rounded number of " + num1 + " is: " + decimals.format(answer));
                             Round2();
                             System.out.println("The rounded number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 0 :
                             if (choice2 == 0) {
                                  System.exit(1);
                             break;
                   return choice2;
              public String anotherCalculation() throws IOException {
                   boolean inputCorrect = false;
                   while (inputCorrect == false) {
                             try {                              
                                  BufferedReader br3 = new BufferedReader (new InputStreamReader(System.in));
                                  System.out.print("\nWould you like to do another calculation? Y/N ");
                                  more = br3.readLine();
                                  String s1 = "y";
                                  String s2 = "Y";
                                  if (more.equals(s1) || more.equals(s2)) {
                                       inputCorrect = true;
                                       while (inputCorrect = true){
                                            inputNumber1();
                                            System.out.println("");
                                            calculatorChoice();
                                            System.out.println("");
                                            inputNumber2();
                                            System.out.println("");
                                            Calculator();
                                            System.out.println("");
                                            anotherCalculation();
                                            System.out.println("");
                                            inputCorrect = true;
                                  } else {
                                       System.out.println("\n" + nameSurname + " thank you for using this program, you have used this program for: " + decimals.format(programRuntime()) + " seconds");
                                       System.out.println("the program will now exit, Goodbye.");
                                       System.exit(0);
                             } catch (IOException ex){
                                  System.out.println("You did not enter a valid answer: " + "\""+ more + "\" is not in the list!!");
                                  inputCorrect = false;
              return more;
         public static void main(String[] args) throws IOException {
              Project p1 = new Project();
              p1.insertNameAndSurname();
              System.out.println("");
              p1.inputNumber1();
              System.out.println("");
              p1.calculatorChoice();
              System.out.println("");
              p1.inputNumber2();
              System.out.println("");
              p1.Calculator();
                   System.out.println("");
                   p1.anotherCalculation();
                   System.out.println("");
    {code}
    *Can you please run my code for yourself and have a look at how this program is constructed*
    *and give me ANY feedback on how I can better this code(program) or if I've done anything wrong from your point of view.*
    Your help will be much appreciated.
    Thanks in advance

    Smirre wrote:
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??You cannot restrict the user. It is a sad fact in programming that the worst bug always sits in front of the Computer.
    What you could do is checking the input string for numbers. If it contains numbers, just reprompt for the Name.
    AND you might want to ask yourself why the heck a calculator needs to know the users Name.

  • Please help me to run this CMP BEAN, I need help urgently, I am running out of time :(

    Hi,
    I am facing this problem, Please help me, I am attaching the source files
    also along with the mail. This is a small CMP EJB application, I am using
    IAS SP2 on NT server with Oracle 8. I highly appreciate if someone can send
    me the working copy of the same. I need these urgent. I am porting all my
    beans from bea weblogic to Iplanet. Please help me dudes.
    Err.........
    [06/Sep/2001 13:41:29:7] error: EBFP-marshal_internal: internal exception
    caught
    in kcp skeleton, exception = java.lang.NoSuchMethodError
    [06/Sep/2001 13:41:29:7] error: Exception Stack Trace:
    java.lang.NoSuchMethodError
    at
    com.se.sales.customer.ejb_kcp_skel_CompanyHome.create__com_se_sales_c
    ustomer_Company__java_lang_Integer__indir_wstr__215617959(ejb_kcp_skel_Compa
    nyHo
    me.java:205)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    com.se.sales.customer.ejb_kcp_stub_CompanyHome.create(ejb_kcp_stub_Co
    mpanyHome.java:297)
    at
    com.se.sales.customer.ejb_stub_CompanyHome.create(ejb_stub_CompanyHom
    e.java:89)
    at
    com.se.sales.customer.CompanyServlet.doGet(CompanyServlet.java:35)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unkno
    wn Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    Caught an exception.
    java.rmi.RemoteException: SystemException: exid=UNKNOWN
    at com.kivasoft.eb.EBExceptionUtility.idToSystem(Unknown Source)
    at com.kivasoft.ebfp.FPUtility.replyToException(Unknown Source)
    at
    com.se.sales.customer.ejb_kcp_stub_CompanyHome.create(ejb_kcp_stub_Co
    mpanyHome.java:324)
    at
    com.se.sales.customer.ejb_stub_CompanyHome.create(ejb_stub_CompanyHom
    e.java:89)
    at
    com.se.sales.customer.CompanyServlet.doGet(CompanyServlet.java:35)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unkno
    wn Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    Thanks in advance
    Shravan
    [Attachment iplanet_app.jar, see below]
    [Attachment iplanet_src.jar, see below]

    One reason that I sometimes get 'NoSuchMethodError' is when I make a change to a
    java class that is imported into another java class. When I go to run the
    importing class, it will throw a 'NoSuchMethodError' on any methods that I've
    changed in the imported class. The solution is to recompile the importing class
    with the changed classes in the classpath.
    shravan wrote:
    Hi,
    I am facing this problem, Please help me, I am attaching the source files
    also along with the mail. This is a small CMP EJB application, I am using
    IAS SP2 on NT server with Oracle 8. I highly appreciate if someone can send
    me the working copy of the same. I need these urgent. I am porting all my
    beans from bea weblogic to Iplanet. Please help me dudes.
    Err.........
    [06/Sep/2001 13:41:29:7] error: EBFP-marshal_internal: internal exception
    caught
    in kcp skeleton, exception = java.lang.NoSuchMethodError
    [06/Sep/2001 13:41:29:7] error: Exception Stack Trace:
    java.lang.NoSuchMethodError
    at
    com.se.sales.customer.ejb_kcp_skel_CompanyHome.create__com_se_sales_c
    ustomer_Company__java_lang_Integer__indir_wstr__215617959(ejb_kcp_skel_Compa
    nyHo
    me.java:205)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    com.se.sales.customer.ejb_kcp_stub_CompanyHome.create(ejb_kcp_stub_Co
    mpanyHome.java:297)
    at
    com.se.sales.customer.ejb_stub_CompanyHome.create(ejb_stub_CompanyHom
    e.java:89)
    at
    com.se.sales.customer.CompanyServlet.doGet(CompanyServlet.java:35)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unkno
    wn Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    Caught an exception.
    java.rmi.RemoteException: SystemException: exid=UNKNOWN
    at com.kivasoft.eb.EBExceptionUtility.idToSystem(Unknown Source)
    at com.kivasoft.ebfp.FPUtility.replyToException(Unknown Source)
    at
    com.se.sales.customer.ejb_kcp_stub_CompanyHome.create(ejb_kcp_stub_Co
    mpanyHome.java:324)
    at
    com.se.sales.customer.ejb_stub_CompanyHome.create(ejb_stub_CompanyHom
    e.java:89)
    at
    com.se.sales.customer.CompanyServlet.doGet(CompanyServlet.java:35)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unkno
    wn Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    Thanks in advance
    Shravan
    Name: iplanet_app.jar
    iplanet_app.jar Type: Java Archive (application/java-archive)
    Encoding: x-uuencode
    Name: iplanet_src.jar
    iplanet_src.jar Type: Java Archive (application/java-archive)
    Encoding: x-uuencode

  • Need help in creating a Physical Inventory Document with HUs given

    Hi Gurus,
    There is a problem I am facing while doing a ALV report.
    I have created the report and there is a button which i have fixed which has to create Physical Inventory Document.
    The scenario is:
    I will select the records in the report based on the Vessel Bill Of Lading (VBOL) (related to Batch characteristics of a material) and then i need to pass those values to create Physical Inventory Document.
    I got a functional module HUINV_DOCUMENT_CREATE which will create the document but I am not clear what are the values that I need to pass in this.
    Or do anyone know how to create the Document by passing HU (Handling Units) and Plant & Storage Location?
    Please help me in the same.
    Thanks and Regards
    Vipin Das V

    Hi ,
            Just Pass the table of Handling Unit .That's all.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Mar 28, 2008 5:12 PM

  • Need help with calculating interest

    Hey im trying to find out where my calculations are screwing up on the interest is coming up wrong but i am unable to find out where. After every month its suppose to be deposit - withdrawl * monthly interest rate and then add that total to the new month etc... any help will be appreciated. Heres my class and test
    public class SavingsAccount
        private double bal;
        private double intRate;
    The constructor initializes an object with a
    balance and an annual interest rate.
    @param bal The account balance.
    @param intRate The annual interest rate.
        public SavingsAccount(double bal, double intRate)
        bal= 0.0;
        intRate = 0.0;
        The withdraw method withdraws an amount from
        the account.
        @param amount The amount to withdraw.
        public void withdraw(double amount)
            bal -= amount;
        The deposit method deposits an amount into
        the account.
        @param amount The amount to deposit.
        public void deposit(double amount)
            bal += amount;
        The addInterest method calculates the monthly
        interest and adds it to the account balance.
        public void addInterest()
        // Get the monthly interest rate.
        // Calculate the last amount of interest earned.
        // Add the interest to the balance.
         intRate = bal * (intRate/12);
         bal += intRate;
        The getBalance method returns the account balance.
        @return The account balance.
        public double getBalance()
        return bal;
        The getInterestRate method returns the annual
        interest rate.
        @return The annual interest rate.
        public double getInterestRate()
        return intRate;
        The getLastInterest method returns the last amount
        of interest earned.
        @return The last amount of interest earned.
        public double getLastInterest()
        return bal;
    import java.util.Scanner;
    import java.text.DecimalFormat;
    public class SavingsAccountTest
        public static void main(String args[])
        // Annual interest rate
           double intRate;
        // Starting balance
           double startBal;
        // Amount of deposits for a month
           double deposit;
           double totalDeposit;
        // Amount withdrawn in a month
           double withdrawn;
           double totalWithdrawn;
        // Interest earned
           double intEarned = 0;
        // Deposit accumulator
           deposit = 0.0;
           totalDeposit = 0.0;
        // Withdrawal accumulator
           withdrawn =0.0;
           totalWithdrawn = 0.0;
        // Months that have passed
           double months;
        // Create a Scanner object for keyboard input.
           Scanner keyboard = new Scanner(System.in);
        // Get the starting balance.
           System.out.println("What is your account's starting balance");
           startBal = keyboard.nextDouble();
           while (startBal < 0)
               startBal=0;
        // Get the annual interest rate.
           System.out.println("What is the annual interest rate?");
           intRate = keyboard.nextDouble();
           while (intRate <= 0 )
               intRate = 0;
        // Create a SavingsAccount object.
           SavingsAccount account = new SavingsAccount(0.0, 0.0);
        // Get the number of months that have passed.
           System.out.println("How many months have passed since the " +
                              "account has opened? ");
           months = keyboard.nextDouble();
           while (months <= 0)
               months = 1;
        // Get the deposits and withdrawals for each month.
        for (int i = 1; i <= months; i++)
        // Get the deposits.
           System.out.println("Enter the amount deposited during month " + i);
           deposit= keyboard.nextDouble();
           totalDeposit += deposit;
           while (deposit <=0)
               deposit = 0;
        // Get the withdrawals.
           System.out.println("Enter the amount withdrawn during month " + i);
           withdrawn = keyboard.nextDouble();
           totalWithdrawn += withdrawn;
           while (withdrawn <= 0)
               withdrawn = 0;
        // Add the deposits to the account.
           startBal += deposit;
        // Subtract the withdrawals.
           startBal -= withdrawn;
        // Add the monthly interest.
           intRate = startBal * intRate/12;
           startBal += intRate;
        // Accumulate the amount of interest earned.
           intRate += intEarned;
        // Create a DecimalFormat object for formatting output.
        DecimalFormat dollar = new DecimalFormat("#,##0.00");
        // Display the totals and the balance.
        System.out.println("Total deposited: " + dollar.format(totalDeposit));
        System.out.println("Total withdrawn: " + dollar.format(totalWithdrawn));
        System.out.println("Total interest earned: " + dollar.format(intEarned));
        System.out.println("Account balance: " + dollar.format(startBal));
    }

    Ok this is what i have fixed up so far but im still having trouble calculating the interest. Problem1) We were given the skeleton to the class and demo. I cannot figure out what to enter in getLastInterest.(completely lost all i need is hint) 2)When i try to get the Total money deposited and i call the account.deposit(balance) it keeps on giving an error void not allowed. Any help is appreciated
    public class SavingsAccount
        private double balance;
        private double interest;
        private double intEarned;
        The constructor initializes an object with a
        balance and an annual interest rate.
        @param bal The account balance.
        @param intRate The annual interest rate.
        public SavingsAccount(double bal, double intRate)
        balance = bal;
        interest = intRate;
        The withdraw method withdraws an amount from
        the account.
        @param amount The amount to withdraw.
        public void withdraw(double amount)
            balance -= amount;
        The deposit method deposits an amount into
        the account.
        @param amount The amount to deposit.
        public void deposit(double amount)
            balance += amount;
        The addInterest method calculates the monthly
        interest and adds it to the account balance.
        public void addInterest()
        // Get the monthly interest rate.
        // Calculate the last amount of interest earned.
        // Add the interest to the balance.
         interest = balance * (interest/12);
         interest = intEarned;
         balance += interest;
        The getBalance method returns the account balance.
        @return The account balance.
        public double getBalance()
        return balance;
        The getInterestRate method returns the annual
        interest rate.
        @return The annual interest rate.
        public double getInterestRate()
        return interest;
        The getLastInterest method returns the last amount
        of interest earned.
        @return The last amount of interest earned.
        public double getLastInterest()
        return intEarned;
    import java.util.Scanner;
    import java.text.DecimalFormat;
    public class SavingsAccountTest
        public static void main(String args[])
        // Annual interest rate
           double intRate;
        // Starting balance
           double balance;
        // Amount of deposits for a month
           double deposit;    
        // Amount withdrawn in a month
           double withdraw;
        // Interest earned
           double intEarned = 0;
        // Deposit accumulator
           deposit = 0.0;  
        // Withdrawal accumulator
           withdraw =0.0;    
        // Months that have passed
           double months;
        // Create a Scanner object for keyboard input.
           Scanner keyboard = new Scanner(System.in);
        // Get the starting balance.
           System.out.println("What is your account's starting balance");
           balance = keyboard.nextDouble();
           if (balance < 0)
               balance=0;
        // Get the annual interest rate.
           System.out.println("What is the annual interest rate?");
           intRate = keyboard.nextDouble();
           if (intRate <= 0 )
               intRate = 0;
        // Create a SavingsAccount object. Cannot find Symbol!!
           SavingsAccount account = new SavingsAccount(balance,intRate);
        // Get the number of months that have passed.
           System.out.println("How many months have passed since the " +
                              "account has opened? ");
           months = keyboard.nextDouble();
           if (months <= 0)
               months = 1;
        // Get the deposits and withdrawals for each month.
        for (int i = 1; i <= months; i++)
        // Get the deposits.
           System.out.println("Enter the amount deposited during month " + i);
           deposit= keyboard.nextDouble();
           account.deposit(deposit);
           if (deposit <=0)
               deposit = 0;
        // Get the withdrawals.
           System.out.println("Enter the amount withdrawn during month " + i);
           withdraw = keyboard.nextDouble();
           account.withdraw(withdraw);
           if (withdraw <= 0 || withdraw >= balance)
               withdraw = 0;
        // Add the deposits to the account.
           account.deposit(balance);
        // Subtract the withdrawals.
           account.withdraw(balance);
        // Add the monthly interest.
           account.addInterest();
        // Accumulate the amount of interest earned. ????? Wrong
           intRate += intEarned;
        // Create a DecimalFormat object for formatting output.
        DecimalFormat dollar = new DecimalFormat("#,##0.00");
        // Display the totals and the balance.
        System.out.println("Total deposited: " + dollar.format(account.deposit(balance)));
        System.out.println("Total withdrawn: " + dollar.format(account.withdraw(balance)));
        System.out.println("Total interest earned: " + dollar.format(account.addInterest()));
        System.out.println("Account balance: " + dollar.format(account.getBalance()));
    }

  • Need help in calculating a total from flowable table

    I've tried everything to include using the example from the tutorial on creating a flowable purchase order form.  My problem is that I can't get the total field to reflect a total.  I'd be willing to send the form to anyone willing to shed some light and provide a solution.
    Thanks

    Paul, I don't believe that I'm grasping exactly what you are saying.  I have several forms at work that I've designed (none with flowable content however) with calculations, it's just I can't seem to get this one to do what I need.  So.... let me plead ignorance on this one for the moment.
    Actually, I have the one row that accepts data, then if the user wants to, they can click on the add item button to add another instance.  Even after entering the one rows data, that amount does not reflect in the total field.  You would likely need to see the form possibly, and if so, let me know.  I'd be glad to have your help in any way you could provide it.
    Mike

  • Need help getting Flash site running after pointed to new nameservers

    Can't get Gaia site working on a new server
    « on: Today at 03:10:35 PM »
    Quote Modify Remove
    Hi.  I recently switched from 1&1 shared hosting to a new webhost, Holistic.
    My Flash site (based on the Gaia framework) doesn't work now.
    Using the Flashplayer Debugger, I got the following error:
    from Main:  view.scaleX = 0.9041666666666667 and view.scaleY = 1.0129032258064516
    from Main:  view.x = 0 and view.y = 0
    Error: Failed to load policy file from xmlsocket://127.0.0.1:5800
    Error: Request for resource at xmlsocket://127.0.0.1:5800 by requestor from http://www.yourgods.com/bin/main.swf has failed because the server cannot be reached.
    *** Security Sandbox Violation ***
    Connection to 127.0.0.1:5800 halted - not permitted from http://www.yourgods.com/bin/main.swf
    Error: Request for resource at xmlsocket://127.0.0.1:5800 by requestor from http://www.yourgods.com/bin/main.swf has failed because the server cannot be reached.
    Also got this note even though I've set allowscriptaccess to always in my index.html:
    Warning: AllowScriptAccess='never' found in HTML.  This setting is ineffective and deprecated.  See http://www.adobe.com/go/allowscriptaccess for details.
    Warning: 'com' has no property 'onEnterFrame'
    Regarding the Security Sandbox violation, my old webhost was 1&1, and they are still the official Registrar of YourGods.com - but I now have YourGods.com pointed at the DomainNameServers for my new host, Holistic, which specializes in Drupal and has no experience with Flash - so I hope you'll bear with me and offer what guidance you can since they said I was basically on my own for troubleshooting any Flash related problems.
    Is that likely to be the source of my problem (that I'm only 'pointing' to the nameservers and have only 'parked' my domain with the new host instead of transferring it completely?
    And if so, do I just need to create a cross domain policy xml file like the one below and leave it on my Old Webhost?
    <?xml version="1.0"?> 
        <cross-domain-policy> 
        <allow-access-from domain="MyNewDedicatedIPAddressHere" /> 
        </cross-domain-policy>
    I've never dealt with this cross domain stuff before so any help would be much appreciated.

    As a test, I uploaded my Flash/Gaia site into an existing site on my old host.  And although the site actually works in this setting, when I run things in the FlashPlayerDebugger, I'm still getting Security Sandbox Violations - so (as adninjastrator suggested in earlier post), this may have nothing to do with the DNS changes - but perhaps with my setting things up wrong somewhere so that the Flashplayer is trying to access my local computer - maybe??
    Debugger logs gives me this:
    Error: Failed to load policy file from xmlsocket://127.0.0.1:5800
    Error: Request for resource at xmlsocket://127.0.0.1:5800 by requestor from http://recreationofthegods.com/bin/main.swf has failed because the server cannot be reached.
    *** Security Sandbox Violation ***
    So, I've now uploaded the identical bin (which contains all the files for my site) - but I'm getting different behaviors on the two hosts.
    On the new holistic servers, the site won't go past the first page:  www.yourgods.com
    On the 1&1 servers, I still get runtime errors in FlashPlayerDebugger - but the site runs ok - http://www.RecreationOfTheGods.com/bin/index.html
    Posting those links in hopes someone with more experience in these sandbox issues can help steer me in the right direction.

  • Need help with Security when running AS3 inside browser

    Hi,
    I am fairly new to flash, but a fairly experienced
    programmer.
    I have created a game that runs perfectly and communicates to
    a WinSock server over port 4000 to publish its final score to.
    Using simple XMLSocket and Send.
    When I run the game in the standalone flash player everything
    works perfectly as it should
    However when I embed in a HTML page or similar it goes wrong.
    The game works fine, but the final posting to the WinSock socket
    server fails. I have retrieved the error message.
    ioErrorHandler: [SecurityErrorEvent type="securityError"
    bubbles=false cancelable=false eventPhase=2 text="Error #2048"]
    My server is a local server to me running IIS 6. Everything
    runs fine by the standalone flash player so I know ports are clear
    and firewalls are not the problem.
    Searching around google and forums I have found out that in
    9,0,124,0 (the flash I am running) that they made some security
    enhancements, namely you need to post a crossdomain file.
    My file is sat in the wwwroot of my webserver where my flash
    swf is hosted and looks like
    <cross-domain-policy>
    <allow-access-from domain="*" secure="false"/>
    </cross-domain-policy>
    I have also tried adding the following to the 1st section of
    the swf file
    Security.loadPolicyFile("
    http://mydomainname.com/crossdomain.xml");
    I have tried all conbinations, but I cannot get the flash to
    communicate to the socket server when it inside a web browser.
    If i run it in the standalone player, everything works
    perfectly.
    Can someone help me please. I have been googling and ripping
    my hair out for ages. This is the final stage of my project and I
    am failing at the final step.
    Just to add.
    My server and testing computer are on the same domain, the
    web server is a win2003 server and my testing and coding server is
    a XP machine running IE7. They are linked by a ADSL router sharing
    the same external IP address but via DHCP addressing. Everything
    works fine for port forwarding of the winsocket port.
    Just to emphasis, I believe this setup is correct, as it all
    works fine when I run in the flash player.
    Many thanks

    I fixed it eventually.
    In flash 9.0.124.0 they now force you to have a socket XML
    server running on port 843 a server somewhere if you wish to use
    XMLSocket inside a browser.
    Nothing to do with domain or crossdomain.xml files.
    You need to also call
    Security.loadPolicyFile("xmlsocket://x.x.x.x:843") before you
    open the socket.
    to load in the XML that defines what is allowed.
    Search google for AS3 and socket server port 843 and you will
    find examples and even a simple Java based server to use.

  • Need Help in Calculation of Paid and Unpaid Break in Daily Work Schedule

    hai,
    I am a student of SAP-HCM. I am having problem with the calculation
    in Paid and Unpaid Break in Daily work schedule (Time Management).
    Please help.
    thank you
    Dev.

    Hi,
    The above screen shot is table where we maintain unpaid and paid breaks, we mention about when a break has to start under START tab and when it has to end under END button.
    Under UNPAID and PAID tabs we mention duration of break,  if its 15 mins break or half an hour or one hour depending on start and end timings.
    Suppose a shift is for 9 hours in total and client wants there should be a paid break of one hour, then out of this 9 hours shift itself  break would be considered.... and in case client wants unpaid break then shift would be for 10 hours out of which 9 hours will be working hours and one hour break.
    When this concept has to be calculated in schema processing type would be assigned to this time pair showing break accordingly either paid or unpaid.

  • NEED HELP PLEASE! Cant run my k7 Master at 266fsb still.

    i run a K7 Master with a 1.4 thunderbird, onboard scsi, a geforce2 ti, along with 4 case fans and power supply fan, 2 scsi harddrives(7500rpm & 10,000rpm), one 80gig ide drive, scsi cd-rom, and all my usb crap so the cheap power supply was giving me problems.  I then upgraded to an Enermax and it cured all of my problems except for the main problem of not being able to run at full speed, 266fsb.  
    It just freezes after about 30minutes of running at 266fsb.  It starts to get weird trails on the mouse pointer and then after about 6 seconds it freezes...
    It doesnt matter what ddr ram I try, what processor, what heatsink, or anything that I try....it still freezes.
    I'm almost certain its a bad motherboard but I dont know if this is common with these boards and if it can be fixed by me or if I have to send it out to get fixed.
    Thanks for any help.
    -Andrew-

    I've got a similar problem, I can't run my comp at its proper speed
    1800+ XP
    MS 6380 KT7266 pro2
    2x256 DDR
    G-Force 2 MX/MX400 64MB 3D
    Soundblaster Live! 5.1
    Seagate 20 gig baracuda 4
    Cyber Drive 8x/4x/32x CDR/RW
    with a 320 watt p4 support power pack (Not to sure if 320s right I think so though, i seems to work fine, the monitoring program shows steady voltage)
    Luceant 56k modem
    I can only get it to run at 1.1 gig - on the 100 mhz FSB setting, when I try to take it above this I get random crash's soon after start up, and sometimes it'll run for a while before it crash's, I got it to do a benchmark using both the mad onion util and SANDRA, though I had the problem sussed when I swapped the modem with my old comp, but the problem started up again the next day and I had to go back to 100 FSB.
    There are definitly no temp issues, the CPU dosn't go above 45 degrees celcius(set as critical temp) and at the moment is running around 31 degrees celcius about 80 degrees farentfeit I think, I wish you americans would give up on farentheight already, its been done, move to the metric system every one else has :P

  • Hey new to Macs need help getting one(s) running again...

    Hey all,
    So I acquired some old Macs from a local schools surplus sale. I have managed to get one operational (a G3 tower) but am now trying to get a MacBook running and have had a few issues. I have gotten it to the flashing folder screen but have been unable to get it to boot from the HDD. The HDD drive works I have installed OSX 10.3 on the drive via firewire but it seems that the Mac wont recognize that the drive is there. When I get into the Startup Manager screen nothing shows up except the mouse (which I can move around). The MacBook is an a1181 with 1GB of Ram installed. Being new to Macs I have no clue on how to continue. I know Macs do not have a BIOS but is there something similar that can be accessed? What about Firmware updating? I would prefer not to have to take it (and others) to the local Apple store. Any and all help would be much appreciated.
    Thanks.

    I have the same MacBook (a1181) and had the same problem. My solution was to simply re-install snow leopard. Just buy a snow leopard CD from the apple store. Don't buy a mountian lion CD because it is not compatible with your MacBook. One you have the SL CD, insert it into the optical drive (CD drive) and boot the computer. When you hear the chime, press and hold down "C" on the keyboard and it should boot. If this fails, reboot and brews and hold option/alt when you hearths chime, then select the CD as it appears. Then simply install snow leopard, and enjoy your Mac! Hope this helps, and I will be happy to help with any problems or questions :)

  • Need help with calculated fields in Adobe Interactive Forms

    Hi Gurus,
    I have an Adobe Interactive form in which i have radio buttons. Upon selecting any of the radio buttons, value in text box should be changed( Calculqated filedS). How i can achieve this?
    Regards,
    Srini
    Moderator message: wrong forum, please post again in Adobe Interactive Forms, but always try yourself before asking.
    Edited by: Thomas Zloch on Jul 13, 2010 11:58 AM

    Hi Tapan
    No, it's working ,with  one remark.
    I've done a mistake, in the final formula. The logic remain the same! ;)
     The calculation values for second column ( COL2 ) are 1,2,3 and not 0,1,2 as I wrote  before and as for COL1 are so the formula is
    =3*if(COL1="ABC",0,IF(COL1="DEF",1,2)+if(COL2="RST",1,IF(COL2="YYZ",2,3)
    and not
    =3*if(COL1="ABC",0,IF(COL1="DEF",1,2)+if(COL2="RST",0,IF(COL2="YYZ",1,2)
    I created also a real example  for you, with 2 dif calculation ways . First I created 2 calc_columns for COL1 and COL2 ( CALC_COL1+CALC_COL and after I added both these 2 column , and second way is to calculate directly) .
    Check this image
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Need help on Calculation Logic in Bex

    Dear BW Experts,
    I am working on Reporting. I have a requirement in my report.
    Output of the Report :
    State_________Material_____Total_Closed_Calls____No of Part Consumed
    Karnataka_____Cell Charger__10_________________2
    _____________Battery_______20________________4
    _____________Pin___________25_______________5
    Result____________________55________________11
    Mumbai______Keypad________20_______________8
    ____________Cover_________10________________5
    Result____________________30________________13
    I want to calculate % of part Consumed.
    ie)(No of Part Consumed /Total Number of Closed Calls) * 100
    In the case of Karnataka, (2 / 55)*100 = 3.6
    State_______Material_____Total_Closed_Calls____No of Part Consumed____% of Consume
    Karnataka___Cell Charger__10____________________2_____________________3.6
    ___________Battery_______20___________________4_____________________7.2
    ___________Pin___________25__________________5_____________________9.0
    Result____________________55__________________11
    Mumbai______Keypad________20_________________8_____________________26.6
    ____________Cover_________10_________________5_____________________20
    Result____________________30__________________13
    How can i achieve this calculation in Bex.
    Please help on this issue.
    Thanks,
    Siva.
    Edited by: Siva Kumar on Jun 29, 2009 11:49 AM

    Create a formula as follows...
    'No of parts consumed'  %CT 'Total number of calls closed'.
    I have also observed that you dont want that calculation for total. I saw that blank in your example.
    If that is the case, then go to "Calculation" tab and select calculate resutl as "HIDE".  That should hide your result value for this particular formula.
    - Danny

Maybe you are looking for

  • Is there a way to manually set a page as "visited" for TOC?

    Hi I am exploring the possibility of using TOC with the setting of "do not allow click on un-visited slides". However, there are some slides that I wish to be able to set as visited even if they are not. I wonder if there is a way can do this? I sear

  • Any one who is doing FICO Certification??

    Hello Everyone, If any one is preparing for below Certification, let me know. SAP Certified Application Associate - Financial Accounting with SAP ERP 6.0 EHP4 We can discuss queries related to that. Thanks, Pinky Moderator: Please, read and respect S

  • Wanting to go "back in time" due to issue with iphoto 8.03

    Everything was great on Sat. before I downloaded iphoto 8.03. Instead of jumping through hoops to try to fix my issues, can't I simply go back using Time Machine to iphoto 8.02? I've made minor changes otherwise to my mac since Sat. that I can duplic

  • LDAP (ADS Read-only) as UME Datasource

    Hi Gurus! We have configured MS Active Directory (Read only) as our UME Datasource.  When I look in the logs in NWA (Last 24 hours) I get the following error: application [webdynpro/dispatcher] Cannot send an HTTP error response [500 Application erro

  • Windows 8.1 (not RT) installation on Surface RT?

    Hello all,  i'm trying to find an answer to a very simple answer but somehow i can't... is it possible to install Windows 8.1 pro on MS Surface RT? I have 8.1RT version installed but I want it as a work machine and since 8.1RT is not supporting joini