Running Totals, is there a method for this

Hello, I am racking my brain out trying to figure out how to do a running total based on each succeding input by the user. It goes like this, if a person has more then x, then it does an if else statement based on the value inputted, else something else. The problem that Im having is trying to figure out how to keep the total in and add it to each successive input, and allowing the whole thing to be ended with a while ! =1.
Any suggestions would be so greatly appreciated.
Best Regards,
MT

I Given below the solution for whatever understand from the question given below.
For example if you run
C:>java Tot 121 150 you will get the following output.
Total No of Inputs : 2
The Input value1=121
The Input value2=150
Total = 271
public class Tot{
     public static void main(String args[]){
          System.out.println("Total No of Inputs : "+args.length);
          int total = 0;
          for(int pos=0;pos<args.length;pos++){
               System.out.println("The Input value"+(pos+1)+"="+args[pos]);
               total = total + Integer.parseInt(args[pos]);
          System.out.println("Total = "+total);
Darma

Similar Messages

  • Exception in Payment Proposal - Pmnt methods for this run are not specified

    Dear all,
    I want to ask if it is possible to run a payment proposal for AP transactions together with AR. The AR line items are used for clearing. Actually, this is the first time we execute proposal run which contains AP and AR respectively. And during the proposal, AR line item is an exception - 'Pmnt methods for this run are not specified in the master record or in item'. We already checked the master record, and there is a payment method. However, it was not captured during the payment proposal. Does it have something to do with the Document Type?
    Thank you once again for all your usual support.
    Regards,
    April

    To: Karthik, pushkaraj, JeCcas_DJ
    Thank you very much for your responses.
    I've checked already FBZP and Customer Master Record, payment methods were defined. Also, during the payment run, all line items have the same payment method, but only the AR transaction was not accepted.
    I think the problem is the same as what pushkaraj mentioned. We have payment method 'D' defined only for outgoing payments and not for incoming payments. I guess that is the problem.
    By the way, can I create another entry 'D' for payment method-incoming payments? Would there be conflict if I assigned same ID?
    Regards and thank you once again...
    April

  • I just test drove a Lexus ES with the Entune system, and it not only didn't play the music I expected, it caused the iPod to become totally unresponsive, even my computer doesn't recognize it?  Is there a fix for this?

    I just test drove a Lexus ES with the Entune system, and it not only didn't play the music I expected, it caused the iPod to become totally unresponsive, even my computer doesn't recognize it?  Is there a fix for this?

    This problem sort of solved itself.  The iPod kept running until the battery went dead, and when I plugged it in to power this morning, it behaved normallyh.

  • I recently updated my Mid 2007 iMac with the latest OS 10.8.5 now my external hard drives will not show up. They show up when I boot them up on a machine running and earlier OS. Is there a fix for this?

    I recently updated my 20-inch, Mid 2007 iMac with the latest OS 10.8.5 now my external hard drives will not show up. They show up when I boot them up on a machine running and earlier OS. Is there a fix for this?

    Can you see them in Disk Utility?
    If so, can you select and Mount them?
    If not, disconnect them, reset the iMac's SMC and then reconnect them.
    Intel-based Macs: Resetting the System Management Controller (SMC)
    1. Shut down the computer.
    2. Unplug the computer's power cord.
    3. Wait fifteen seconds.
    4. Attach the computer's power cord.
    5. Wait five seconds, then press the power button to turn on the computer.
    If you still can not see them, connect them back up to the iMac running the older OS, open Disk Utility and look to see how they are partitioned and formatted.

  • My mail program frequently asks for passwords that I have provided and saved many times.  I am running Snow Leopard and have run the Keychain repair a few times to no avail.  Is there a fix for this or do I have to find another email program?

    I am running Snow Leopard and have run the Keychain repair a few times to no avail.
    Is there a fix for this or do I have to find another email program?

    This is frequent, not just occasionally.  All cancel does is stop the email from coming through until I provide the password.
    I thought about it being on the provider's end but it never happened when I was using Entourage, I just don't particularly like that program.
    I don't understand why this problem has gone on so long without Apple doing something to fix it but I will continue to look for alternatives to the Apple Mail program.  If I find a good one I will let all know through avenue.
    Thanks again to all who tried to help.

  • Firefox won't remember my passwords, even though I have told it to. Is there a fix for this? I am running Windows7

    I have told Firefox to remember the password(s) I use on many different websites. It never remembers any of them. Is there a fix for this? I am using Firefox 4.0.1 and Windows 7.

    Do you mean names and passwords in the Password Manager or do you mean that you are no longer logged on to (remembered by) websites after closing and restarting Firefox?
    If Firefox doesn't offer to store passwords in the Password Manager then check that you aren't running Firefox in [[Private Browsing]] mode.
    Websites remembering you and automatically log you in is stored in a cookie.
    * Create an allow cookie exception (Tools > Options > Privacy > Cookies: Exceptions) to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    * In [[Private Browsing]] mode all cookies are session cookies that expire if that session is ended, so websites won't remember you.
    * Do not use [[Clear Recent History]] to clear the "Cookies" and the "Site Preferences"
    Clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.
    * http://kb.mozillazine.org/Cookies

  • EXS 24 crashes when I load any sample. Is there a fix for this, perhaps an install / reinstall poison as such? Any help would be very grateful.

    EXS 24 crashes when I load any sample. Is there a fix for this, perhaps an install / reinstall option as such? Any help would be very grateful.
    I purchased the iMac second hand and is in very tidy condition only used for production.  I'm not totally clued up on the Mac side if things as I was a windows user for years. Please be gentle ! :)

    Thank you. I figured it out right before I heard from you.  Running the OCR before the redaction made it work correctly.
    Thank you so much for taking the time to answer my question.
    Make it a great day.
    BG10

  • Tiling and collision methods for this app

    I plan on making a game where the player travels down though a level. I have created basic player/objects collision games using AS2 & Mclips for browser/PC and some basic AS3 apps also, but I want to focus on making this one to run well/fast on iOS and Android via flash/AIR.
    The goal will be for the player to avoid colliding with rock/tiles.  There will not be too many enemies to track but a few powerups may be on the rock edges to pickup.
    Can someone give me any suggestions/links for current Tiling and Collision methods for this environment? Should I use starling?

    Thanks Glad, I hear that a pixel perfect collision method like bitmapdata hittest can be a tremendous overhead in CPU time, but I guess I will have to try it and see.

  • Is there a way to print from ipad 4 to a non AirPrint printer? I have a Canon Pixma MP 620 wifi which works fine with my PC but I don't want to buy a new printer. Is there an app for this or adaptors which could work?   thank, Ric

    Is there a way to print from ipad 4 to a non AirPrint printer?
    I have a Canon Pixma MP 620 wifi which works fine with my PC but I don't want to buy a new printer.
    Is there an app for this or adaptors which could work? 
    Thank, Ric

    Printopia is another option but be aware that since these solutions effectively act as a print server and AirPrint receiver, they require a computer to be running on the same WiFi network.
    Canon also has a couple of apps in the App Store that might facilitate this on non-AirPrint printers. Check out...
    Canon Easy-PhotoPrint
    Canon Mobile Printing
    PIXMA Printing Solutions

  • I upgraded my iPad 2 to iOS8 and keep getting knocked off of cellular data. Is there a fix for this? Can  I downgrade back to iOS7?

    I recently upgraded the software on my iPad 2 to iOS8.02. Since upgrading the iPad is running slower and choppier, with several apps no longer working. In addition, it keeps knocking me off my cellular data and showing no service. Is there any fix for this, or can I downgrade the iOS back to 7?

    I'm sorry, but Apple does not provide a downgrade path for iOS. Because downgrading is unsupported by Apple we cannot discuss it on these forums.
    You may leave comments at Apple Feedback.

  • I have just updated to Lion and now my folders no longer show number of items on the bottom. Is there a fix for this?

    I have just updated to Lion and now my folders no longer show number of items on the bottom. Is there a fix for this? I allways found that handy. Now I have to click on an icon on the top, This is a backward step if that is now the only way to see the number of items. Am I missing something obvious?

    Parrotcat wrote:
    I have just updated to Lion and now my folders no longer show number of items on the bottom...    
    In the good old days of Snow Leopard, an open Finder folder had a border along the bottom of the window which could show the number of items in that window and the total available space on the hard disk or partition that folder resides on. That bottom border is gone in Lion and those two bits of information are gone with it. Is that what you're talking about? If so, I'd like to learn how to get it back too and "Show Item Info" is not the way.

  • 10.2 crashes when I try to convert old libraries for use in the new software. Is there a workaround for this? Or will i have to continue using the previous version to complete older projects?

    Final Cut Pro X 10.2 crashes when I try to convert old libraries for use in the new software. Is there a workaround for this? Or will I have to continue using the previous version to complete older projects? the only foreseeable solution is to begin any new projects on 10.2 or importing footage on 10.2 and starting form scratch--which is something i definitely don't want to do or have time to do. ANY advice, thoughts, or opinions would be greatly appreciated! Thank you!
    Running 10.10.3 // MacBook Pro (Retina, 15-inch, Early 2013) // 2.4 GHz Intel Core i7 // 8 GB 1600 MHz DDR3

    Exactly the same problem with me.
    Some other threads advice to remove fonts, clean the caches, remove add ins but nothing works consistenty, for some it looks like it works, for me it failed.
    What I did not try yet, was to move the Render files out of the malicious library to trash.

  • Is there a method for counting words?

    Hi!
    Is there a method for counting words?
    How do I read specific data ( row, column ) out of an array?
    Thx
    Lebite

    There's could be a better way, but this is how I would do it:
            String[][] myArray = { {"Blah Blah Blah"},
                                   {"Blah Blah Blah"},
                                   {"Blah Blah Blah"} };
            int tokens = 0;
            for(int i = 0; i < myArray.length; i++)
                for(int j = 0; j < myArray.length; j++)
    StringTokenizer st = new StringTokenizer(myArray[i][j]);
    tokens += st.countTokens();
    System.out.println(tokens);

  • Encoding process isn't working properly while making the disk image (or DVD)in my iDVD program.   Is there a remedy for this?

    I've used Old Toad's suggestion and made a disk image first because the DVDs I've tried to produce show a few pictures in playback and then go white.  The slideshow works fine in the iDVD program, and in the initial rendering stage all seems o.k. until the encoding step.  Then, it processes 4 or 5 pictures, then goes blank but the music continues to be processed.  Is there a remedy for this (I know Apple has ditched the program and the optical drives.)  I deleted the project and tried making it over from scratch, but no luck.

    I am simply lookig for some help not an argument.  I am not an RF specialist however have setup a few wireless networks in my tenure at Wynn Resorts.  I fully agree that wireless networking is an art and a science however the powers that be in Network Land have toughted wireless networking is the easiest and quickest way to get two computers to talk with one another.  As I previously said I have already turned one (1) MBP in for this problem and Apple decided to replace it because they could not fix the problem with my particular MBP.  This MBP was running Leopard when the problems started
    I am having a hard time believeing that there are several other devicces in my home that depend on a wireless network to operate and my MBP is the only one having an issue.  I took this a step further and decided to see what would happen if I tried to connect wirelessly via Fusion.  In Windows 7 I am able to print and scan to my hearts content without any issues.  I am able to browse the internet as much as I want.  I close Fusion and try to connect to my printer via wireless and nothing.
    In order to get Apple to help do I need to get a Network Analyzer and capture packets when I have these problems?  Out of the 1000 + posts is there a consolidation of which answer is the best?  BTW I am accessing the internet via a wireless connection using Fusion and Windows 7.
    In response to Linc's comments, I will look at the router specifications however I did not qualify that these devices are not using the wireless connection at the same time.  Right now I would guess there are maybe two (2) or three (3) at the most that are actively transmitting / receiving information. --  Thanks

  • IPhone 3GS will not sync calendars because the sync server failed.   Just installed Outlook 2010.  Is there a fix for this?

    My iPhone 3GS could not sync calendars to the iPhone because the sync server failed to sync the iPhone.    Just installed Outlook 2010.   Is there a fix for this?

    I am simply lookig for some help not an argument.  I am not an RF specialist however have setup a few wireless networks in my tenure at Wynn Resorts.  I fully agree that wireless networking is an art and a science however the powers that be in Network Land have toughted wireless networking is the easiest and quickest way to get two computers to talk with one another.  As I previously said I have already turned one (1) MBP in for this problem and Apple decided to replace it because they could not fix the problem with my particular MBP.  This MBP was running Leopard when the problems started
    I am having a hard time believeing that there are several other devicces in my home that depend on a wireless network to operate and my MBP is the only one having an issue.  I took this a step further and decided to see what would happen if I tried to connect wirelessly via Fusion.  In Windows 7 I am able to print and scan to my hearts content without any issues.  I am able to browse the internet as much as I want.  I close Fusion and try to connect to my printer via wireless and nothing.
    In order to get Apple to help do I need to get a Network Analyzer and capture packets when I have these problems?  Out of the 1000 + posts is there a consolidation of which answer is the best?  BTW I am accessing the internet via a wireless connection using Fusion and Windows 7.
    In response to Linc's comments, I will look at the router specifications however I did not qualify that these devices are not using the wireless connection at the same time.  Right now I would guess there are maybe two (2) or three (3) at the most that are actively transmitting / receiving information. --  Thanks

Maybe you are looking for