Pausing Loop Displays

Greetings to all:
I am currently enrolled in my first JAVA class and am struggling with my current program requirements. Below is the code I wrote so far, I am trying to figure out how to pause the loop to display one page of information at a time instead of the continous scroll. I would greatly appreaciate any ideas suggestions.
import java.math.*;
import java.text.*;
import java.util.*;
// The Payment class displays a predetermined monthly mortgage payment
public class Payment
     public static void main(String[]arguments)
          //Creates variables
          double Amount;
          int Term;
          double InterestRate;
          //Assigns values to variables
          Amount = 200000.00;
          Term = 30;
          InterestRate = .0575;
          //Alters the display format of Amount variable
          NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US);
          String s = n.format(Amount);
          //Creates variables
          double MonthlyInterestRate;
          int TotalMonths;
          double Payment;
          //Assigns values to variables
          MonthlyInterestRate = InterestRate / 12;
          TotalMonths = Term * 12;
          Payment = Amount* MonthlyInterestRate / (1-(Math.pow((1+MonthlyInterestRate ),(-TotalMonths))));
          //Takes Payment variable and round answer to 2 decimal points
          BigDecimal bd = new BigDecimal(Payment);
bd = bd.setScale(2, BigDecimal.ROUND_UP);
          //Instructions to display various varibles
          System.out.println("Cost of Mortgage "+ s);
          System.out.println("Length of Term " + Term);
          System.out.println("Interest Rate 5.75% ");
          System.out.println("The monthly payment of this loan is $" + bd);
          System.out.println();
          //Creates new set of variables
          double MonthlyInterest;
          double MonthlyPrincipal;
          double TotalInterestPaid;
          int NumberofPayments;
          //Creates Balance variable
          double Balance;
          //Initialization of Balance variable
          Balance = 200000;
          TotalInterestPaid = 0;
          NumberofPayments = 360;
          //creates loop
          do
          MonthlyInterest = Balance * (InterestRate / 12);
          MonthlyPrincipal = Payment - MonthlyInterest;
          Balance = Balance - MonthlyPrincipal;
          TotalInterestPaid = TotalInterestPaid + MonthlyInterest;
          NumberofPayments = NumberofPayments - 1;
          //Takes current balance and rounds the answer to two digits
          BigDecimal bb = new BigDecimal(Balance);
bb = bb.setScale(2, BigDecimal.ROUND_UP);
          BigDecimal tip = new BigDecimal(TotalInterestPaid);
                    tip = tip.setScale(2, BigDecimal.ROUND_UP);
          System.out.println("New Loan Balance " + bb);
          System.out.println();
          System.out.println("Total Interest Paid " + tip);
          System.out.println();
          //Loop condition
          while (NumberofPayments > 0);
//Ends Application

here's another way
import java.text.*;
import java.util.*;
import java.io.*;
import java.math.BigDecimal;
class Payment
  public static void main(String[]arguments)
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    try
      double amount = 200000.00;;
      int term = 30;
      double interestRate = .0575;
      NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US);
      String sAmount = n.format(amount);
      double monthlyInterestRate = interestRate / 12.0;
      int totalMonths = term * 12;
      double payment = amount*monthlyInterestRate/(1-(Math.pow((1+monthlyInterestRate),(-totalMonths))));
      BigDecimal bd = new BigDecimal(payment);
      bd = bd.setScale(2, BigDecimal.ROUND_UP);
      System.out.println("Cost of Mortgage "+ sAmount);
      System.out.println("Length of Term " + term);
      System.out.println("Interest Rate 5.75% ");
      System.out.println("The monthly payment of this loan is $" + bd);
      System.out.println();
      double monthlyInterest;
      double monthlyPrincipal;
      double totalInterestPaid = 0;
      int numberOfPayments = 360;
      double balance = amount;
      do
        monthlyInterest = balance * (interestRate / 12.0);
        monthlyPrincipal = payment - monthlyInterest;
        balance -= monthlyPrincipal;//perhaps should be less monthly payment
        totalInterestPaid += monthlyInterest;
        numberOfPayments--;
        BigDecimal bb = new BigDecimal(balance);
        bb = bb.setScale(2, BigDecimal.ROUND_UP);
        BigDecimal tip = new BigDecimal(totalInterestPaid);
        tip = tip.setScale(2, BigDecimal.ROUND_UP);
        System.out.println("New Loan Balance " + bb);
        System.out.println();
        System.out.println("Total Interest Paid " + tip);
        System.out.println();
        if(numberOfPayments %12 == 0)//12, or pick whatever number you want
          System.out.print("\nPress [ENTER] to continue...");
          String junk = input.readLine();
      }while (numberOfPayments > 0);
    catch(Exception e){e.printStackTrace();}
}

Similar Messages

  • How to get line no of row whsoe button is pushed in step loop display

    Hi experts.
    In step loop i have a button too with the other fields.which is being displayed on the left side of every row.now i just want that to get the no of that row of which the button is pushed.
    i am using GET_CURSOR_LINE but it fails i.e when a cursor is in third row and i press the button of 2nd row, in this way it gives me the line no 3 but it should be the 2.
    Note: I am using step loops not the table control in dynamic programing.
    it is a great challenge for all experts.

    hi experts hi.
    what happend.
    does any body know nothing
    plz just tell that iz it possible.
    or any help...any any help
    experts where r u all?

  • Reading Data from a Queue - Store in Fast Loop, Display in Slow Loop

    Here's my BD below.  I am queueing data in a faster loop (either 100 ms or 50 ms) and sending that data to a 250 ms loop.  I need to be able to display the data in the slower loop (so that the FP doesn't have to update every 50 ms).
    Problem I'm having:  How do I empty the data?  It builds and builds and eventually I'm looking at a chart that has data that's 1 minute old.  I've tried writing my own flush code (attached).  I've tried to use variables to pass data and use an array to parse...not working.  Any help would be appreciated.
    Nathan - Certified LabVIEW Developer
    Solved!
    Go to Solution.
    Attachments:
    FlushQueuebyNathan.vi ‏21 KB

    If you need all of the data to go into the chart, I would use the flush queue and write to the chart in a FOR loop (autoindexing with the elements array from the flush queue).  You may set the Defer Front Panel Updates before the FOR loop and reset it after, but I'm not sure that will buy you that much.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Scroll bars not required in step loop display in mobile device

    Hi,
    We have a requirement where we are displaying a module pool program in a hand held mobile terminal.
    The requirement is that we have to display a table without any vertical scroll bar. Horizontal scroll bar is required to scroll between the columns.
    We have made use of Step loop to display fixed number of rows on the screen at a time. However since all the columns are not getting displayed completely on the screen we are getting both vertical and horizontal scroll bars even though vertical scroll bar is not required. The number of rows are fixed such that they fit perfectly on screen.
    Is there a way to remove vertical scroll bar in Step loop or any other method?

    You need to change the CSS file.

  • ThinInstaller with SCCM - Progress pauses at "Displaying License Notice"

    I have been using ThinInstaller successfully during my ConfigMgr task sequences for some time now, but after updating UpdateRetriever and ThinInstaller to the most recent versions, and adding some content to my repository, I have the following issue:
    The ThinInstaller process seems to hang at a specific step when run during my task sequences. The task sequence kicks off my ThinInstaller package, which installs the ThinInstaller files locally, and then runs a command to point to my driver repository. The specific command run is:
    "PathToThinInstaller\ThinInstaller.exe" /CM -search A -action INSTALL -repository "PathToRepository" -noicon -includerebootpackages 1,3,4 -showprogress -noreboot
    And it seems like the ThinInstaller application scans the local system and determines which updates are required. However, until I press "F8" (and only F8), there is no GUI displayed (even though I am using the -showprogress command line argument) and no driver packages are downloaded or installed. Looking at the log files on such a machine, I see the progress pause at a specific step. Quick note: It's just a coincidence in the logs below that I hit F8 about an hour after the progress paused:
    Info 2013-09-27 , 04:15:53
    at Tvsu.Coreq.CoreqProcessor.ProcessUpdatesImplementation(Update[] updates)
    Message: Ending Coreq process: Return21Updates
    Info 2013-09-27 , 04:15:53
    at Tvsu.Gui.GUIController.DisplayLicenseNotice(Boolean picklist)
    Message: Displaying License Notice.
    Info 2013-09-27 , 05:15:22
    at Tvsu.Gui.GUIController.StartInstallGUI()
    Message: Setting -ShowProgress Install Progress screen...
    Info 2013-09-27 , 05:15:22
    at Tvsu.Gui.GUIController.StartInstallGUI()
    Message: **About to Install 21 updates.
    Based on that snippet, progress paused around 4:15, with the last step being "Displaying License Notice". I let the machine go until about 5:15, then pressed F8 (to launch a debug command prompt window in the ConfigMgr task sequence) and immediately after pressing F8, the ThinInstaller UI appears and ThinInstaller progress resumes with the "Settings -ShowProgress Install Progress screen" log entry. When I press F8, there is no license prompt displayed or anything requiring user interaction - it just suddenly starts running again, and will eventually run to successful completion. I can confirm that the ThinInstaller.exe.configuration XML file on the workstations I'm building is still in the default configuration, with DISPLAYLICENSENOTICE = NO and IGNORELOCALLICENSE=YES.
    The curious thing is that I can run this exact package manually, using the exact same script that is called by the ConfigMgr task sequence, and it runs to completion, no issues, no license prompts, no need for user intervention, nothing. I did not make any changes to the command lines being used by my scripts - only changed the versions of UpdateRetriever and ThinInstaller. And technically, my task sequences still work, it's just very annoying to have to watch for this step in the process and press F8 to keep it from sitting and doing nothing.
    Has anyone else seen anything like this after an upgrade to new UpdateRetriever/ThinInstaller versions?

    Unfortunately, these page numbers do not correspond to anything in the v.4 TVSU deployment guide.  I've re-read all of the applicable areas in the guide, but still cannot get past one thing.  The guide does NOT seem to give a way to avoid ALL license messages.
    Due to the fact that TVSU does not load the registry parameters on first startup, I've resorted to a method given by several others on the internet that involves (using a script launched via SCCM) (script shown below) starting TVSU, using TASKKILL to kill the process, and then making registry changes to set parameters.  I then run a second step that launches TVSU again via command line which should do the 2nd launch of TVSU without having any popups.  HOWEVER, I still get one license popup.  It seems you do not get credit for the first launch when you kill the process without agreeing to the license.
    Here is the code:
    First step script:
    cmd /c "C:\program files (x86)\Lenovo\System Update\tvsu.exe"
    cmd /c TASKKILL /F /IM tvsukernel.exe
    REG ADD "HKLM\SOFTWARE\Lenovo\System Update\Preferences\UserSettings\General" /v ExtrasTab /t REG_SZ /d NO /f
    REG ADD "HKLM\SOFTWARE\Lenovo\System Update\Preferences\UserSettings\General" /v IgnoreLocalLicense /t REG_SZ /d YES /f
    REG ADD "HKLM\SOFTWARE\Lenovo\System Update\Preferences\UserSettings\General" /v DisplayLicenseNotice /t REG_SZ /d NO /f
    REG ADD "HKLM\SOFTWARE\Lenovo\System Update\Preferences\UserSettings\General" /v DisplayLicenseNoticeSU /t REG_SZ /d NO /f
    Second step command line:
    cmd.exe /c tvsu.exe /CM -search A -action INSTALL -repository \\server\share -includerebootpackages 1,3,4 -noreboot -noicon
     When I check the tvsu_log, I see that when the license dialog pops up, the log file reads, "Message: Display pick list license notice? YES"
    This is the license notice I need to get past.  Is there any way to suppress this license notice, given that I've already made the registry changes detailed above?

  • Script looping display result

    Hey just a simple question about loops in script editor:
              Below I have the Fibonacci sequence:
    set fibs to {}
    set x to (text returned of (display dialog "What fibbonaci number do you want?" default answer "3"))
    set x to x as integer
    repeat with y from 1 to x
                   if (y = 1 or y = 2) then
                                  copy 1 to the end of fibs
                    else
                                   copy ((item (y - 1) of fibs) + (item (y - 2) of fibs)) to the end of fibs
                    end if
    end repeat
    return item x of fibs
    Just wondering how to display iteration 1,1,2,3,5,8,.....etc  and not just the final result. Thanks.

    Fibs is a list of numbers, {1, 1, 2} for example. If you try to print that Applescript will complain because it can't print out lists, only strings. So you need a string representation of the list. You need to take each element of the list and add that to a string.
    It would be possible to do this by iterating over the list item by item and converting each item to text and adding it to a string variable. (A good exercise for the reader) but Applescript gives us an easier way.
    In Applescript is a property, Applescript's text item delimiters, which tells Applescript how to split a string up or combine a list into a string.
    In the case of splitting Applescript will split a string at each text item delimiter character. So if you  had a string "555-1111-2222" and set Applescript's text item delimiters to "-" then that string would be broken at each dash and you would get three items from it, the three parts of the phone number.
    In the case of combining the text item delimiter is placed between each item of the list when it is converted into a string. In your case you wanted a comma between each number so I set the text item delimiter to ",".
    The
    set {oldtid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ","}
    is just a way of setting multiple variables in one shot. Each item from the first list is set to the corresponding item of the second list. So we save the current
    text item delimiter in oldtid an set it to the comma. Then when we are done with it we set it back to what it was, a good habit to get into.
    Hope this helps
    regards

  • My iphone4 is stuck on an endless loop displaying the apple logo after restore setting and "erase all my personnal data" (forgot the word), what to do?

    I am from Lebanon so there aren't any apple store nearby and can't download 666,6MB with my poor internet especially since on itunes you can't hold the download or at least when you update,
    I just bought the Iphone yesterday from someone and been searching on the net for more than 3 hours
    please help

    I would first do a SMC and PRAM reset.  See this link:
    http://www.makeuseof.com/tag/reset-macs-smc-pram/

  • Write a query to display HI using stars(for loop using)

    Hi all
    can u tell me please how to write this query
    HI
    write a query using for loop display the stars(*) in the place of H and I
    thanks regards
    Edited by: user9195968 on Apr 20, 2010 11:18 PM
    Edited by: user9195968 on Apr 20, 2010 11:26 PM

    user9195968 wrote:
    Hi all
    can u tell me please how to write this query
    HI
    write a query using for loop display the stars(*) in the place of H and I
    thanks regardsHere's a starter for you...
    SQL> ed
    Wrote file afiedt.buf
      1  with a as (select 'A' as ch, 2 as line1, 5 as line2, 7 as line3, 5 as line4, 5 as line5 from dual union all
      2             select 'B', 4, 5, 5, 5, 5 from dual union all
      3             select 'C', 3, 4, 4, 4, 3 from dual union all
      4             select 'D', 6, 5, 5, 5, 6 from dual union all
      5             select 'E', 7, 4, 6, 4, 7 from dual union all
      6             select 'F', 7, 4, 6, 4, 4 from dual union all
      7             select 'G', 3, 4, 5, 5, 2 from dual union all
      8             select 'H', 5, 5, 7, 5, 5 from dual union all
      9             select 'I', 7, 2, 2, 2, 7 from dual union all
    10             select 'J', 7, 1, 1, 1, 6 from dual union all
    11             select 'K', 5, 6, 4, 6, 5 from dual union all
    12             select 'L', 4, 4, 4, 4, 7 from dual union all
    13             select 'M', 5, 7, 5, 5, 5 from dual union all
    14             select 'N', 5, 5, 7, 5, 5 from dual union all
    15             select 'O', 2, 5, 5, 5, 2 from dual union all
    16             select 'P', 6, 5, 6, 4, 4 from dual)
    17  --
    18      ,w as (select 'HI' as word from dual)
    19  --
    20      ,chrs as (select rownum as chnum, substr(word,rownum,1) as ch
    21                from w
    22                connect by rownum <= length(word))
    23  --
    24  select decode(rn,1,decode(bitand(line1,4),4,'*',' ')||decode(bitand(line1,2),2,'*',' ')||decode(bitand(line1,1),1,'*',' '))||
    25         decode(rn,2,decode(bitand(line2,4),4,'*',' ')||decode(bitand(line2,2),2,'*',' ')||decode(bitand(line2,1),1,'*',' '))||
    26         decode(rn,3,decode(bitand(line3,4),4,'*',' ')||decode(bitand(line3,2),2,'*',' ')||decode(bitand(line3,1),1,'*',' '))||
    27         decode(rn,4,decode(bitand(line4,4),4,'*',' ')||decode(bitand(line4,2),2,'*',' ')||decode(bitand(line4,1),1,'*',' '))||
    28         decode(rn,5,decode(bitand(line5,4),4,'*',' ')||decode(bitand(line5,2),2,'*',' ')||decode(bitand(line5,1),1,'*',' '))
    29  from chrs join a on (a.ch = chrs.ch)
    30       cross join (select rownum as rn from dual connect by rownum <= 5) x
    31* order by chnum, rn
    SQL> /
    DECODE(RN,1,DEC
    10 rows selected.
    SQL>To display characters as stars (as per the unix banner command) you need some sort of bitmap representation of your character set. As I've done, you can define your own, or you could probably get at the internal fonts somehow (I used to do this sort of thing in machine code back on the BBC Master, but not sure how you'd access the font/character set information from within Oracle)
    If you actually want the H and the I displaying next to each other then that's a little more work, but you can have a go at that yourself.

  • Navigation - How to pause at end display time?

    I want to the slide to pause or display indefinitely till the
    user clicks a button. In the Slide Properties dialog, it seems like
    there should be a 'do nothing' option in the Navigation dropdown,
    but there's not. How can I achieve this effect of pausing at the
    end of a slide?

    Hi again GI2000
    Seems you misunderstood me. If you use a Click Box or a
    Button object, the slide pauses dead in its tracks
    until your user clicks. They do not have to click the object
    to pause. It pauses automagickally and waits for an action.
    Then again, maybe it's me that's misunderstanding what you
    are wanting to do?
    Cheers... Rick

  • Ending Loop

    I have a mortgage calculator that dispalys the monthly payment, principle and interest paid, and principle remaining. The program works great, but doesn't stop at 360 months like is should. Below is the code. How do I get the program to end after 360 months?
    Thanks!
    import java.text.NumberFormat;
    import java.util.Locale;
    class Mortgage_Calc
    public static void main(String[]arguments)throws Exception{
         //Allows For Currency Format
         NumberFormat formatter = NumberFormat.getCurrencyInstance(Locale.US);
         // Define the variables
         char ans = 'Y';
         double prin;
         double apr;
         double mo_Payments;
         double monthly_Interest;
         double monthlyInterestPaid;
         double monthly_principle;
         // Standard Integers
         int months; // Set months for later calculations
         int term = 30; // Number of Years
         int yearCnt = 1; // Counter for Years to increment in 12 Months (While Loop)
         int yearpluscnt; // Counter for Years (For Loop)
         int mthPaymentNum = 1; // Counter used later
         int max_Months; // Maximum Months
         //hard coded values
         prin = 200000; // Principle Value of the Mortgage
         apr = .0575; // Annual Percentage Rate
         // Calculate Values
         monthly_Interest = (apr / 12); // Monthly Interest Percentage
         months = (term * 12); // Total Amount of Months in the Term
         max_Months = months;
         monthlyInterestPaid =(prin * monthly_Interest); //monthly interst paid
         //Equation to calculate monthly payment
         mo_Payments = (prin * monthly_Interest) / (1-Math.pow(1 + monthly_Interest,- months));
         //monthly payment on the principle calculation
         monthly_principle = (mo_Payments - monthlyInterestPaid); //monthly principle
         // print Payment Summary
         System.out.println("\n\n\t Loan Summary\n");
         System.out.println("\n\n\t The amount of the mortgage is " + formatter.format(prin));
         System.out.println("\t With an annual interest rate of " apr * 100"%");
         System.out.println("\t your monthly payments will be " formatter.format(mo_Payments) " per month");
         System.out.println("\t for a term of "+term+ " years.\n\n");
         System.out.println("\n\t Here is the amortization schedule:");
         //Pause 3 seconds before displaying amortization schedule
         try
         Thread.sleep(3000);
         catch (InterruptedException e) {}
              // Do While Loop
              while(ans=='Y' || ans=='y'){
              // Print Headings
              System.out.println("\t--------------------------------------------------------------");
              System.out.println("\n\t Month \t Priciple Left \t Principle Paid \t Interest Paid\n");
              System.out.println("\t--------------------------------------------------------------");
                   // For Loop To print Each Months Numbers
                   yearpluscnt=mthPaymentNum+12;
                   for (mthPaymentNum = yearCnt; mthPaymentNum < yearpluscnt ; mthPaymentNum++ ){
                   //The new principle balance after subtracing from the remainder principle balance
                   prin = (prin - monthly_principle);
                   months = (months - 1);
                   //monthly interest paid calculation
                   monthlyInterestPaid = (prin * monthly_Interest);
                   //monthly payment on the principle calculation
                   monthly_principle = (mo_Payments - monthlyInterestPaid);
                        //Pausing before showing output for 2 seconds
                        try
                        Thread.sleep(50);
                   catch (InterruptedException e) {}
                   // Output Monthly Payment Information
                   System.out.println("\t" + mthPaymentNum + "\t" +
                   formatter.format(prin) + "\t" + formatter.format(monthly_principle) +
                   "\t\t\t" + formatter.format(monthlyInterestPaid));
              System.out.print("\n\n\tWould you like to Continue? Y or N:");
              ans=(char)System.in.read();
              System.in.read();
              System.in.read();
              yearCnt = yearCnt+12;
              System.out.println("\n");
    }

    Sorry, I am new to this forum - I don't know the rules yet.
    To be more specific, I want my program to stop calculating after 30 years or 360 months.
    What do I need to add to make this happen?
    import java.text.NumberFormat;
    import java.util.Locale;
    class Mortgage_Calc
    public static void main(String[]args)throws Exception{
         //Defines currency format
         NumberFormat formatter = NumberFormat.getCurrencyInstance(Locale.US);
         // Define the variables
         char ans = 'Y';
         double apr;
         double monthly_Interest;
         double monthlyInterestPaid;
         double monthly_Payments;
         double monthly_principle;
         double principle;
         // Standard Integers
         int months; // Set months for later calculations
         int term = 30; // Number of Years
         int yearCnt = 1; // Counter for Years to increment in 12 Months (While Loop)
         int yearpluscnt; // Counter for Years (For Loop)
         int mthPaymentNum = 1; // Counter used later
         int max_Months; // Maximum Months
         //hard coded values
         principle = 200000; // Principle Value of the Mortgage
         apr = .0575; // Annual Percentage Rate
         // Calculate Values
         monthly_Interest = (apr / 12); // Monthly interest rate
         months = (term * 12); // Total number of months in the term
         max_Months = months;
         monthlyInterestPaid =(principle * monthly_Interest); //Monthly interst paid
         //calculation for monthly payment
         monthly_Payments = (principle * monthly_Interest) / (1-Math.pow(1 + monthly_Interest,- months));
         //calculation for monthly principle paid
         monthly_principle = (monthly_Payments - monthlyInterestPaid); //monthly principle
         // print payment summary
         System.out.println("\n\n\t Loan Summary\n");
         System.out.println("\n\n\t The amount of the mortgage is " + formatter.format(principle));
         System.out.println("\t With an annual interest rate of " +apr * 100+"%");
         System.out.println("\t your monthly payment will be " +formatter.format(monthly_Payments)+ " per month");
         System.out.println("\t for a term of "+term+ " years.\n\n");
         System.out.println("\n\t Here is the amortization schedule:");
         //3 second pause before displaying amortization schedule
         try
         Thread.sleep(3000);
         catch (InterruptedException e) {}
              //loop
              while(ans=='Y' || ans=='y'){
              // print headings
              System.out.println("\t-------------------------------------------------------------------");
              System.out.println("\n\tMonth\tInterest Paid \tPrinciple Paid \tPrinciple Balance\n");
              System.out.println("\t-------------------------------------------------------------------");
                   // for loop to print each months numbers
                   yearpluscnt=mthPaymentNum+12;
                   for (mthPaymentNum = yearCnt; mthPaymentNum < yearpluscnt ; mthPaymentNum++ ){
                   //The new principle balance after subtracing from the remainder principle balance
                   principle = (principle - monthly_principle);
                   months = (months - 1);
                   //monthly interest paid calculation
                   monthlyInterestPaid = (principle * monthly_Interest);
                   //monthly payment on the principle calculation
                   monthly_principle = (monthly_Payments - monthlyInterestPaid);
                        //Pause between monthly display
                        try
                        Thread.sleep(50);
                   catch (InterruptedException e) {}
                   // Print monthly payment information
                   System.out.println("\t" + mthPaymentNum + "\t" +
                   formatter.format(monthlyInterestPaid) + "\t\t" + formatter.format(monthly_principle) +
                   "\t\t\t" + formatter.format(principle));
              System.out.print("\n\n\tWould you like to Continue? Y or N:");
              ans=(char)System.in.read();
              System.in.read();
              System.in.read();
              yearCnt = yearCnt+12;
              System.out.println("\n");
    }

  • Report is displaying blank?

    hi all
    my report with less parameters is working fine but when i increased parameters its showing me report can anyone guide me plz.its displaying blank page
    here is my codes:
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    plid ParamList;
    vParamValue number;
    BEGIN
    plid := Get_parameter_List('tmp');
    IF NOT Id_Null(plid) THEN
    Destroy_parameter_List( plid );
    END IF;
    plid := Create_parameter_List('tmp');
    add_parameter(plid,'P_num',text_parameter,to_char(:pays.num));
    add_parameter(plid,'p_code',text_parameter,to_char(:pays.code));
    add_parameter(plid,'p_basic',text_parameter,to_char(:pays.basic));
    add_parameter(plid,'p_housing',text_parameter,to_char(:pays.housing));
    add_parameter(plid,'p_water',text_parameter,to_char(:pays.ele_water));
    add_parameter(plid,'p_transport',text_parameter,to_char(:pays.transport));
    add_parameter(plid,'p_desc',text_parameter,to_char(:pays.description));
    add_parameter(plid,'p_amount',text_parameter,to_char(:pays.amount));
    add_parameter(plid,'p_deduct',text_parameter,to_char(:pays.deduction));
    add_parameter(plid,'p_net',text_parameter,to_char(:pays.net_amount));
    add_parameter(plid,'p_total',text_parameter,to_char(:pays.total));
    add_parameter(plid,'p_other',text_parameter,to_char(:pays.other));
    add_parameter(plid,'p_money',text_parameter,to_char(:pays.money_in_words));
    add_parameter(plid,'p_num2',text_parameter,to_char(:payslip.num));
    add_parameter(plid,'p_name',text_parameter,to_char(:payslip.employee_name));
    add_parameter(plid,'p_gender',text_parameter,to_char(:payslip.gender));
    add_parameter(plid,'p_nat',text_parameter,to_char(:payslip.nationality));
    add_parameter(plid,'p_martial',text_parameter,to_char(:payslip.martial_status));
    add_parameter(plid,'p_date',text_parameter,to_char(:payslip.join_date));
    add_parameter(plid,'p_job',text_parameter,to_char(:payslip.job_title));
    add_parameter(plid,'p_bank',text_parameter,to_char(:payslip.bank));
    add_parameter(plid,'p_account',text_parameter,to_char(:payslip.account_no));
    add_parameter(plid,'p_year',text_parameter,to_char(:payslip.year));
    Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
    repid := FIND_REPORT_OBJECT('REPORT6');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no');
    v_rep := RUN_REPORT_OBJECT(repid,plid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('http://sara:8889/reports/rwservlet/getjobid'
    ||substr(v_rep,instr(v_rep,'_',-1)+1)
    ||'?'
    ||'server=repserver&P_num='||:pays.num
    ||'&p_code'||:pays.code
    ||'&p_basic'
    ||:pays.basic||'&p_housing'
    ||:pays.housing||'&p_transport'||:pays.transport
    ||'&p_water'||:pays.ele_water||'&p_amount'
    ||:pays.amount||'&p_deduction'||:pays.deduction
    ||'&p_netamount'||:pays.net_amount
    ||'&p_total'||:pays.total||'&p_other'
    ||:pays.other||'&p_word'||:pays.money_in_words
    ||'&p_num2'||:payslip.num
    ||'&p_name'||:payslip.employee_name
    ||'&p_gender'||:payslip.gender||'&p_nat'
    ||:payslip.nationality||'&p_martial'
    ||:payslip.martial_status||'&p_date'
    ||:payslip.join_date||'&p_job'
    ||:payslip.job_title||'&p_bank'
    ||:payslip.bank||'&p_account'
    ||:payslip.account_no||'&p_year'
    ||:payslip.year||'&paramform=no','_blank');
    END;
    Edited by: SarahSarahSarah on Aug 16, 2009 4:20 AM
    Edited by: SarahSarahSarah on Aug 16, 2009 4:23 AM

    sarah,
    Check the query in the report. The reason for blank report will be the query returning blank. So check the report's query in SQL *PLUS or other softwares like TOAD, SQL Developer etc.
    Regards,
    Manu.

  • PID loop rate with counters

    I'm trying to use a PXI-8106 RT and LabviewRT 8.5 as a PID controller to control 3 motors.  I'm measuring the speed of the motors by measuring the frequency of the encoder with a 6608.
    This article http://zone.ni.com/devzone/cda/tut/p/id/5423 claims a speed up to 107.5 khz.  I've set ethernet to polling and usb off, I didn't turn off  the CPU display, but I'll try that as soon as I can. However, I'm not anywhere close to 107khz, best I can get is about 10khz with one channel and about 2 khz with 3 channels.  I realize the tests were done with analog inputs, but I was hoping that  I'd get at least somewhere close using counters. With the 2Khz rate I really can't do what I need to do.
    Does anyone know what a realistic rate would be with this setup?
    I'm new at Labview so I may be doing something wrong, although I can't see what it could be. I've done quite a bit of research on the forums before I started to learn from other's examples.
    Here's a couple of things I've learned  trying to optimize my loops.
    Seems like Daqmx has some issues with applying a scale.  I have 2 scales, one is just a scale factor, 0.166, the other is .0002.  When applying the .0002 factor in Daqmx my performance takes  a huge hit, something like 10%!  If I just leave it at hz, and do the scaling myself I see no performance penalty.
    There is something strange about the timed loop % display in RT8.5, I wrote my own routine using expected end, actual end time, and the period to give me a % loop useage and it matches very well to the RT8.5 display for most of the time, however, when the loop starts missing iterations because I've gone over 100% the RT display drops down to about 50% which pretty much makes it useless.
    I've attached a couple of shots of my test loop. I can get this one to almost hit 10 khz. the other screen shots are of how I set up the counter, and how I read the counter. the read counter has the error trap to restart itself.  Also I set it to use DMA explicitly somewhere else in the program.
    Thanks for any help.
    Henri
    Attachments:
    Main Loop.JPG ‏55 KB
    Setup Counter.JPG ‏72 KB
    Read Counter.JPG ‏67 KB

    Devin,
    Thanks for the suggestions.
    A couple of related questions for you.
    The 200 uSec is leftover from my attempts at getting the 3 PID loops to work within the loop availability.  I can run  about 70 uSec i.e about 14khz  with only  a single counter.
    I've tried changing the buffers value and it has barely any effect on the speed of the loop. Right now I have 3 counters running with 200uSec timing and I get about 69% loop utilization. With a few missed iterations every once in a while. This is using 10000 samples, if I drop down to 100 samples utilization actually goes up to 70%!?  Doesn't make sense to me either, but this is using both my VI and the on screen Timed Structures % of LV8.5RT so I'm trusting it as real,
    In theory if I can get my loop rate up to 10 khz I'll only need 10 for the buffers since my top frequency to be measured is 100 kHz.
    Funny thing on the RT fifo variable... I turned on FIFO and it actually decreased performance by about 1%, both Total load and Time structures went up... so I turned it off for stop-RT, and got a 3% improvement! Down to 66% time structures.
    You mentioned the hardware timing to get a hardware timed single point. Unless I misunderstood the counters, this isn't possible since the sample rate is implicit in the frequency measured? i.e. it latches the count every rising edge.. so I'm my case I'd get a 100 khz sample rate (although obviouslyl that would be the max) Can you let me know if I've missed something there.
    I bought this system explicitly based on its dual core and its high speed so I could close my PID loops quickly enough with one CPU and still have processing time left over to log data, etc.  And the 6608 card is there so I can get high accuracy for my frequency measurements.   However, I'm really struggling to get this thing going.
    Any help would be greatly appreciated.
    Thanks
    Henri

  • PDF Forms in Firefox - infinite loop

    Howdy,
         I am a developer who is using PDF forms (FDF) to populate data into a database via form submission. Everything works fine on Internet Explorer but, on Firefox 3.6.17 with Adobe Reader X, I either end up getting a blank form when launched from an FDF which has valid data OR, I get into a situation where new firefox windows come up continuously in what appears to be an infinite loop (have to log out to end the recursion). Anyway, figured I'd see if anybody here had seen that before and, if so, if there's a solution to it?
    Thanks!

    I have a similar problem, but apparently in the inverse direction. We recently "upgraded" to Acrobat X (Version 10.1).
    I have a web application that uses data in a database to populate a PDF form displayed in a browser window. (Display in browser window is checked.) At the beginning of August, we started to get an infinite loop whenever trying to display the form.
    Behavior pattern:
    (1) Click the link that's supposed to open the new form. A new IE window opens (as is supposed to happen). Status says "connecting" but there's nothing in the  URL.
    (2) 1/2 second later, a file download popup appears.
    (3) 1/2 second later,  Adobe Acrobat window appears (as if I had run Acrobat as a program). There are 4  windows on the screen at this point, including the normal application window.
    (4) After a 1/2  second delay, system goes into infinite loop, displaying (1) and (2) in an  infinite sequence.Window 3 (Acrobat) seems to simply stay open. Howeve
    Cycle time is about 1/2 second for all 3  popup windows to display one time. This occurs on 19 different  computers (different models, but all running Windows Vista Enterprise, Internet Explorer 7 and Acrobat 10.1.

  • Slideshow display using Apple TV?

    I want to continuously loop/display a slideshow on Apple TV during our daughter's graduation party. I really don't want to have a computer open/available for anyone to mess with it. I'll have a house full of relatives and teens. I can only imagine the damage that would be done on the computer if I leave it out and running. Is there a way to do this without having to keep the computer on/available?
    I've read a little bit about using iTunes and exporting a slideshow from iPhoto into iTunes and using Home Sharing. If I set it up this way does my laptop have to be involved at all or can I just do this through Apple TV/iTunes?
    Please very basic steps. I'm having a hard time wrapping my head around the Apple TV process.
    Thanks much,
    Ginger

    If you intend to mirror your Mac Pro it would need to be the newest model, released late 2013. If you have another Mac that is from 2011 or later that would work. It would also need to be running OSX 10.8 or later
    http://support.apple.com/kb/ht5404

  • Pause and Killswitch suggestions

    The attached image is not a finished product, but should give you a good idea of what I want the program to do.
    The basic purpose of the program is to control a function generator to do a frequency sweep (yes, the driver/generator has a sweep function available even though I don't use it, I just use labview to do the sweeping instead, is this a bad way of achieving the sweep?)
    The program needs to be able to 1) pause at any time so that the user can adjust the amplitude of the signal and 2) it needs to have an output killswitch as well, so that with a button click the amplitude immediately turns off, but will restart from where it was when I hit continue.
    To achieve this I have made 2 case structures with buttons and I want your advice/feedback on how I have chosen to program this.  Again, the program isn't nearly finished, just trying to figure out how I am going to set it up.
    Also, the error handling is not completely set up yet, should I send it through both the pause loop and the killswitch loop as well as the driver up top that sends the device the data?
    Attachments:
    RS101.JPG ‏79 KB

    So I started playing with an event structure and I am running into a problem (I also took out the actual instrument drivers and replaced them with indicators so that I can test run the program and see what is sent to the device).
    In the image, the main "for loop" is excecuted when the run button is clicked at the bottom - this works fine.
    The "pause loop" has not been formatted for the event structure yet (I have an issue with the "Kill Output" function that will also be a problem with the pause function, so I will get to that).  The pause works pretty well as it is, it will pause the "for loop" until I tell it to continue and it will replace the old amplitude with the new one, but I would like to make it so that the pause is an event.  More on that in a second.
    The "kill output function" is an event handled by case 1 (case 1 not shown, there isn't much to it anyway, especially without the driver).  The problem I am having with this is that it will not excecute until after the for loop has completed, and that is no good.  I need it to work just like the pause function shown, to interrupt the for loop and execute the kill output event.  Unlike the pause function, it does not have to resume the for loop after excecution.  If I can't interrupt the for loop, then I cannot use the event structure and will have to go back to the way it was.
    There is another issue with the "pause loop" that I will run into if I make it an event instead of a case structure, and that is the shift registers that go through it (I made the wires thicker to highlight it).  If the "pause button" is false, the "amplitude" just gets passed right on through the structure and does not change, but if I press pause then the "new amplitude" is sent to the shift register instead, and I am not sure how to pass data through the event structure like that.  Also, upon completion of the "pause" the program needs to resume where it left off in the "for loop" without losing its place... not sure how to do this with the event structure either.
    Advice is appreciated, and pictures are wonderful
    Attachments:
    RS101.JPG ‏110 KB

Maybe you are looking for