Loops and Arrays help

Hi,
I'm a freshman in college and new to java. I am completely lost and really need help with a current assignment. Here are the instructions given by my teacher...
Building on provided code:
Loops and Arrays
Tracking Sales
Files Main.java and Sales.java contain a Java application that prompts for and reads in the sales for each of 5 salespeople in a company. Files Main.java and Sales.java can be found here http://www.ecst.csuchico.edu/~amk/foo/csci111/labs/lab6N/Main.java
and here http://www.ecst.csuchico.edu/~amk/foo/csci111/labs/lab6N/Sales.java It then prints out the id and amount of sales for each salesperson and the total sales. Study the code, then compile and run the program to see how it works. Now modify the program as follows:
1. (1 pts) Compute and print the average sale. (You can compute this directly from the total; no new loop is necessary.)
2. (2 pts) Find and print the maximum sale. Print both the id of the salesperson with the max sale and the amount of the sale, e.g., "Salesperson 3 had the highest sale with $4500." Note that you don't necessarily need another loop for this; you can get it in the same loop where the values are read and the sum is computed.
3. (2 pts) Do the same for the minimum sale.
4. (6 pts) After the list, sum, average, max and min have been printed, ask the user to enter a value. Then print the id of each salesperson who exceeded that amount, and the amount of their sales. Also print the total number of salespeople whose sales exceeded the value entered.
5. (2 pts) The salespeople are objecting to having an id of 0-no one wants that designation. Modify your program so that the ids run from 1-5 instead of 0-4. Do not modify the array-just make the information for salesperson 1 reside in array location 0, and so on.
6. (8 pts) Instead of always reading in 5 sales amounts, allow the user to provide the number of sales people and then create an array that is just the right size. The program can then proceed as before. You should do this two ways:
1. at the beginning ask the user (via a prompt) for the number of sales people and then create the new array
2. you should also allow the user to input this as a program argument (which indicates a new Constructor and hence changes to both Main and Sales). You may want to see some notes.
7. (4 pts) Create javadocs and an object model for the lab
You should organize your code so that it is easily readable and provides appropriate methods for appropriate tasks. Generally, variables should have local (method) scope if not needed by multiple methods. If many methods need a variable, it should be an Instance Variable so you do not have to pass it around to methods.
You must create the working application and a web page to provide the applications information (i.e., a page with links to the source code, the javadoc and an object model) to get full credit. You can use the example.html's from the last two labs to help you remember how to do this.
I'm not asking for someone to do this assignment for me...I'm just hoping there is someone out there patient and kind enough to maybe give me a step by step of what to do or how to get started, because I am completely lost from the beginning of #1 in the instructions.
Any help would be much appreciated! Thank you!
Message was edited by:
Scott_010
Message was edited by:
Scott_010

First ask the person who gave this asignment as to why do you require two classes for this , you can have only the Sales.java class with main method in it . Anyways.
Let Main.java have a main method which instanciates a public class Sales and calls a method named say readVal() in Sales class.
In the readVal method of sales class define two arrays i.e ids and sales. Start prompting the user for inputting the id and sales and with user inputting values keep storing it in the respective arrays .. Limit this reading to just 5 i.e only 5 salesPerson.
Once both the arrays are populated, call another method of Sales class which will be used for all computations and output passing both the arrays.
In this new method say Compute() , read values from array and keep calculating total,average and whatever you want by adding steps in just this loop. You can do this in readval method too after reading the values but lets keep the calculation part seperate from input.
You must create the working application and a web page to provide the applications information (i.e., a page with links to the source code, the javadoc and an object model) to get full credit. You can use the example.html's from the last two labs to help you remember how to do this. I think this is ur personal stuff , but if you want to use web page , you probably will require to use servlet to read values from the html form passed to the server.

Similar Messages

  • Loops and arrays

    Hi
    I'm trying to write a loop that does the following :-
    Takes an array of index values that applies to a string adds one to the value of the index and then returns the character in this position.
    There are only four types of character within the string so I have tried to solve it with the following code:-
    for (int i=0; i < indexa.length; i++)
        if(genome.charAt(indexa[i] + 1) == 'a')
            indexia[i] += indexa;
    else if(genome.charAt(indexa[i] + 1) == 'c')
    indexic[i] += indexa[i];
    else if(genome.charAt(indexa[i] + 1) == 'g')
    indexig[i] += indexa[i];
    else if (genome.charAt(indexa[i] + 1) == 't')
    indexit[i] += indexa[i];
    I'm trying it this way but it does'nt seem to work - I've only succeeded in confusing myself - any tips would be much appreciated

    Sorry, I should have explained it better.
    The situation I've got is something like this:-
    I've got a string that looks something like this
    'aactgctcct'
    next - I've got four different arrays, each corresponding to the index of each character a, c, t and g
    so they look something like this
    indexa = {0,1}
    indexc = {2,5,7,8}
    indext = {3,6,9}
    indexg = {4}
    I am presently stuck at the next part - for which I have to return the character that is to the immediate right of the index value in the string that was analysed initially.
    e.g. for indexa ;
    0 = a
    1 = c
    for indexc;
    2 = t
    5 = t
    7 = c
    8 = t
    etc
    I don't know if this makes my predicament any clearer - I'm a genetics student this java is very new to me - I'm kinda muddling through but this bit has got me stumped !!!

  • Result set looping and arrays??????????

    Hey i have a result set problem in using an applet connected to a database.
    After i have accessed a database, i am using a result set to store these values, then put them into arrays to out put to screen. im using:
    count = 0;
    while(rs.next())
    lecturer[count] = rs.getString("FirstName") + " " + rs.getString("Surname");
    room[count] = rs.getString("Room_No");
    sentence = rs.getString("Subjects");
    if(sentence.length()>12)
    space = sentence.indexOf(" ");
    subject[count] = sentence.substring(0,(space));
    subject2[count] = sentence.substring((space+1),sentence.length());
    else
    subject[count] = sentence;
    subject2[count] = " ";
    timeslot[count] = rs.getInt("Time_slot");
    count++;
    resCount++;
    rs.close();
    stm.close();
    The while is there untill there are no more values in the result set. This should work(in theory). But for some reason the while loop goes around and around until 'size' (which is the size for all the arrays) is reached. This is a set value at the start of the applet. But whenever i change it the while loop goes around that many times without fail. this results in duplicate outputs to screen, that i dont want.
    Anyone got any ideas????????????

    This flow doesn't make too much sense to me. Why are you setting an absolute limit on the length of the array, if it should really be determined by the number of rows in your resultset. It sounds like you would be better off using a Collection class, like:
    List names = new ArrayList();
    while(rs.next()) {
      names.add(rs.getString("name"));
    }

  • Help with looping and counting

    i am in a CS 1 class and need help with this loop
    /*Write a program that will allow the user to enter a character
              until the capital letter Z is entered
         The program should count the number of letters entered
              and print the total after the loop is completed*/
    here is what i have it doesn't end nor does it count and i don't know hwo to make it count also i suck at do..while loops hehe
    char b,Z=0;
              Scanner a = new Scanner(System.in);
         do
                   System.out.print("Enter a letter: "+"\n");
                   b=a.next().charAt(0);
              while (b !=Z);
    i know that its not even close to being right just help me out here
    Edited by: purplesmurf on Nov 14, 2008 7:25 PM

    The following program will count the number of chacters entered until Z is enetered.
    import java.io.*;
    class count
         public static void main(String[] args)throws IOException
              char ch;
              int cnt=0;
              DataInputStream br=new DataInputStream(System.in);
              do
              System.out.print("Enter a character:");
              ch=(char)br.read();
              if(ch!='Z')
                   cnt++;
              else
                   break;
              }while((ch=(char)br.read())!='Z');
              System.out.println("The Number of entered characters are:"+cnt);
    }

  • Need help w/ for loop, a do loop, and a do-while loop.

    Hello I have been trying to write a program that uses a for, do, and a do-while loop, but I am having trouble. I need the program that will prompt the user to enter two numbers. The first number must be less than the second number. I need to use a "for loop", a "do loop", and a "do-while loop" to display the odd numbers between the first number and the second number. For example, if the user entered 1 and 8, the program would display 3,5,7 three different times (one for each of the loops). Please help if you can. Thanks.

    boolean2009 wrote:
    Thank all of you all for responding.Youre welcome.
    Yes this is my homework, but my major does not even involve java i just have to take the class.Not our problem.
    And yes we are suppose to have all three in one program I do not know why,So you can learn all three types of loops (there is also an enhanced for loop to learn later on).
    but I just do not understand programming nor do i really want to.Once again not our problem.
    If anybody could help it would be much appreciated. thanks.Yes, a lot of people are willing to help you. No, none of them will do it for you. What you need to do is attempt the code and when you get stuck, post your code using the code button, include error messages, indicate which lines in your code genereate those error messages and ask specific questions.

  • HT1349 Successfully loaded ios7 to iphone 4S from iTunes...now iphone asks me to agree to terms and privacy, then it locks up and won't accept my "agree." Goes in a loop and can't get past this screen.  Pls help.  thanks.

    successfully loaded ios7 to iphone 4s.
    now iphone asks me to agree to terms and privacy, then it locks up and won't accept my "agree."
    goes in a loop and can't get past this screen.  Pls help.  thanks.

    Have you tried resetting the device?
    Hold down the home and lock buttons until you see an Apple Logo, then release the buttons.
    If that doesn't work, you should check to see if you have a backup because you may have to restore your device.

  • Urgent - I have written select query between loop and endloop, Ple help out

    Can any one help out me on this select query. I have written select query between loop and endloop. When I execute the program it will take too much time in this query. Please help me out. Its very urgent.
    LOOP AT l_i_invoices ASSIGNING <l_invoices>.
          CLEAR alv_wa.
          alv_wa-bukrs = <l_invoices>-bukrs.
          alv_wa-gsber = <l_invoices>-gsber.
          CLEAR l_instid.
          CONCATENATE <l_invoices>-belnr <l_invoices>-gjahr INTO l_instid.
          SELECT top_wi_id FROM sww_wi2obj INTO TABLE l_i_swwwihead
                  WHERE catid   = c_catid_business_object
                    AND instid  = l_instid
                    AND typeid  = c_typeid_invoice
                    AND removed = space
                    AND ( wi_rh_task = c_task_buyer_message
                       OR wi_rh_task = c_task_buyer_message2 ).
          IF sy-subrc = 0.
            <l_invoices>-flag = 'X'.
          ELSE.
            <l_invoices>-flag = ' '.
          ENDIF.
          MODIFY l_i_invoices FROM <l_invoices> TRANSPORTING flag
                                WHERE belnr = <l_invoices>-belnr
                                   AND gjahr = <l_invoices>-gjahr.
          APPEND alv_wa TO i_alv.
        ENDLOOP.
    Thanks in advance.

    Here is a way to solve this problem.
    Choose somewhere before this loop processing to use that select. Therefore, you'll need use FOR ALL ENTRIES <that_loop_table> clause, and in the WHERE condition you need to specify that same fields.
    This way, you will have an internal table with all data you'll need to check.
    Then, inside your loop statement, use the READ TABLE command with the clause WITH KEY field = value, to read that record and use the value found.
    Like this sample:
      SELECT bukrs lifnr umsks umskz augdt augbl zuonr gjahr belnr buzei
             waers xblnr blart gsber ebeln zfbdt zbd1t zlsch
      INTO TABLE tg_bsak
      FROM bsak
      FOR ALL ENTRIES IN tl_bkpf_sel
      WHERE bukrs EQ tl_bkpf_sel-bukrs AND
            lifnr IN s_lifnr AND
            augbl EQ tl_bkpf_sel-belnr.
    LOOP AT tg_bseg INTO wa_bseg.
        READ TABLE tg_bsak INTO wa_bsak WITH KEY bukrs = wa_bseg-bukrs
                                                 gjahr = wa_bseg-gjahr
                                                 belnr = wa_bseg-belnr
                                                 BINARY SEARCH.
    if sy-subrc = 0.
    * do something
    endif.
    ENDLOOP.

  • TS3694 Apple 4s stuck in a loop and not restoring or updating Help please!!!!

    Apple 4s stuck in loggo loop and not restoring or updating. I have tryed all the recomended stuff all the youtube video EVRYTHING!!!!! I cant think of any reasone for it to not work .one minuet it was playing music on my sterio and the next this loggo loop.   HELP PLEASE!! **** YOU APPLE!!!!

    Maybe:
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable              
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar                              
    Or
    Restore loop (being prompted to restore again after a restore successfully completes)
    Troubleshoot your USB connection. If the issue persists, out-of-date or incorrectly configured third-party security software may be causing this issue. Please follow Troubleshooting security software issues. .
    Next try placing in DFU mode and then restoring.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    Then try restoring on another computer.
    Last, make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • I am looping and  through an array comparing two bigdecimals:

    I am looping and through an array comparing two bigdecimals:
    I get the max for valueB only if I have multiple items. not when I have one item why would that be:
    val=0;
    if (array.compareTo(valueB) > 0) {                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi. You were wise to trace the value of n. Your problem seems
    to be that the tests succeed (almost always) in the very first
    iteration because they truly don't match (where n = 0) and
    execution breaks out. You need to adjust the logic. As one
    approach, while sticking with your code and not changing it too
    much (such as using more efficient int vs Number):
    at the very top, define a counter var ct:int = 0;
    before the testing loop, define a flag, such as var
    flag:boolean = false;
    you could then invert the logic in the loop and test for ==
    rather than for !=
    if you find a match, do--> flag = true;
    and break
    at the end of testing, use the flag to decide whether to
    store the new value
    if (!flag) {
    // add to array
    ct++;
    also, use a while loop for controlling the whole thing-->
    while(ct < max) { }
    to know when you're done
    You can also check out the Array functions indexOf() and
    some(), to make things more efficient and faster/easier
    when you're all done, you can also look into using if (a != b
    && c != d)
    for efficiency, instead of nesting them separately
    good luck :)

  • Help in loop and at new

    Hallow I have a program that call to smart form. The user have to put course number and employee number and  the program check if the student pass the course send sf and if don’t  send other sf .my problem is when the user put just course number in, other words he wont to print sf of all the student that do some course , I don’t now how to call to smart form in loop because all the time I have a new student and the program have to check if the student pass the course or not and send sf accordingly.
    I heard about at new but I don’t now how to use it or if its fitting my need .
    regards
    IF pernr IS INITIAL .
    *--For-Empty-Pernr--
      SELECT objid_e 
      FROM yhr_score_page
      INTO wa_score_tab-objid_e
      WHERE objid_e IN c_course.
        IF sy-subrc = 0.
          APPEND wa_score_tab TO score_tab.
          CLEAR wa_score_tab.
        ENDIF.
      ENDSELECT.
    ELSE.
      SELECT objid_e 
        FROM yhr_score_page
        INTO wa_score_tab-objid_e
        WHERE objid_e IN c_course
        AND objid_p = pernr.
        IF sy-subrc = 0.
          APPEND wa_score_tab TO score_tab.
          CLEAR wa_score_tab.
        ENDIF.
      ENDSELECT.
    ENDIF.
    This is  the call fo the smart form
    IF sum_n GE passed_nuric. " if student pass course use first function
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname               = 'YHR_SCORE_SMART_FORM_PASS'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
       IMPORTING
         fm_name                  = /1bcdwb/sf00000005
    EXCEPTIONS
      NO_FORM                  = 1
      NO_FUNCTION_MODULE       = 2
      OTHERS                   = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION '/1BCDWB/SF00000005'
        EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
          score_tab2                 = wa_score_tab2
          sum_all                    = sum_all
          sum_n                      = sum_n
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        TABLES
          score_tab                  = score_tab
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *--dont pass--
    ELSE.
      READ TABLE score_tab INDEX 1 INTO wa_score_tab.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname               = 'YHR_SCORE_SMART_FORM'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
       IMPORTING
         fm_name                  = /1bcdwb/sf00000002
    EXCEPTIONS
      NO_FORM                  = 1
      NO_FUNCTION_MODULE       = 2
      OTHERS                   = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION '/1BCDWB/SF00000002'
        EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
          score_tab                  = wa_score_tab
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

    LOOP AT itab.
    AT NEW stud.
      perform xxxx.
    ENDAT.
    ENDLOOP.
    Refer SF
    Refer this link for Smartforms
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d937ec90-0201-0010-0ca8-b6cb3b6dd1ef
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b590fd97-0301-0010-db90-d09ff93cee5a
    Subroutine in smartform
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    Style and mailing the Smartform output
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    Table,Template,Loop and Command in Smartform
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985

  • I am having a terrible problem trying to get a player to loop and play all the time.  Please help

    Heres my code. I added a bunch of extras in there in hope that it will work.  It does auto start, however it won't keep looping and restart it.  Whats wrong with it?
    I have loop = true and i have autorewind = true autoplay=true autostart=true.  I don't get it.
    <object id="player1" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.115" width="250" height="250">
          <param name=bgcolor value="#FFFFFF">
          <param name=movie value="players/player.swf">
          <param name=allowfullscreen value="false">
          <param name=allowscriptaccess value="always">
          <param name="flashvars" value="file=http://www.websitename.flv&autostart=true&loop=true&fullscreen=false&amp;controlbar=bottom &autoPlay=true&amp;autoRewind=true">
          <param name="SCALE" value="exactfit">
          <param name="LOOP" value="true">
          <embed src="players/player.swf" width="250" height="250" loop="truhe" scale="exactfit" name="player1" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" bgcolor="#FFFFFF" allowfullscreen="false" allowscriptaccess="always" flashvars="file=http://www.websitename.flv&autostart=true&loop=true&image=&fullscreen=false&controlbar=bot tom&autoPlay=true&amp;autoRewind=true"></embed>
        </object>

    Hi, you are welcome
    eidnolb

  • Comparing arrays - help!

    Hello. I've been trying to solve this problem for hours, and I would be most grateful for any help you can give me.
    Basically, I'm trying to compare two arrays of char and tell first how many are the same in the same place (I can do that) and then how many are the same but not in place. However, if there are two of one char in one array, and one of the same char in the other, I only want to count it once.
    The problem is, I can't figure out how to do this. I'm using for loops and then setting the char to 0 if it finds a match. This doesn't work. I tried using a series of if statements but I got weird run time acceptions sometimes, and when I put in more if statements to combat that, 1.) it got too confusing and 2.) still only worked half the time. So I'm back to the for loops.
    Here's what I have:
    for (int j = 0; j<guess1.length; j++){
    for(int k = 0; k<code1.length; k++){
    if(code1[k]== guess1[j]){
    code1[k]=0;
    guess1[j] = 0;
    almost = almost + 1;
    So if the code is BBYG and the guess is BWWY, it should return 1 correct and one almost. It will return the one correct, but then return 3 for the almost. It looks at the B in guess which already returned the correct and find it an almost against both B's. When it should have been set to 0 in the correct for loop.
    Sorry, I ramble a bit. Hope you can help!
    Thanks.

    You're gonna love this.
    Unless you have some annoying and patently backward lecturer who wants you to everything the hard way then get ye nose into:
    1. the Collections framework.
    http://java.sun.com/docs/books/tutorial/collections/index.html
    2. and the Collections class itself.
    http://java.sun.com/javase/6/docs/api/java/util/Collections.html
    Hint: a Map can be used to find the distinct items in a list.

  • Combining formula node and arrays for calculatio​n

    Hello all!
    I have two arrays containing values defined by me. Each value of respective column and row index shall be used in a formula to calculate the new value for the respective column and row, to build a new array for further use. This shall be done several times during a simulation with variable function parameters.
    I am aware that I should probably use a for loop for this calculation, but I am curious to how I should build such a procedure.
    Any ideas?

    Hi Euler123,
    Let's say that you have an array of fix size and with values in it. Then you'll need to use auto indexing at the beginning of each for loop input tunnel (usually it is by default for for loops) as shown below:
    In the first iteration of the other for loop, it will take the first row values [1, 2, 3] and pass it to the inner for loop (unless you want to extract the values for each column, transpose that 2D array before connecting it to the outer for loop). In the inner for loop, it will execute 3 times and each iteration it will extract each element from the array obtained from the outer for loop. 
    To build the new array, it's just the opposite. Pass the element out from the for loop and instead of getting a last value tunnel, you'll get an auto indexing tunnel (default for for loops).
    Anyways, you'll need to get some basic understanding on LabVIEW first. Here's some tutorials to aid you on understanding For Loops.
    http://www.youtube.com/watch?v=ziOnPNJgeVg
    Here's some additional notes which might help you:
    http://zone.ni.com/reference/en-XX/help/371361J-01​/lvhowto/auto_indexing_1/
    http://zone.ni.com/reference/en-XX/help/371361H-01​/lvhowto/auto_indexing_1/
    http://zone.ni.com/reference/en-XX/help/371361G-01​/lvhowto/auto_indexing_1/
    Play around with For Loops and use something to slow the execution down like Highlight Execution which allows you to see what is going on. Else, take up some LabVIEW courses
    Warmest regards,
    Lennard.C
    Learning new things everyday...

  • Looping and setting cfset values (from a query)

    Stuck on how to get this to work.
    How would I go about looping and setting these values instead
    of doing them individually?
    The query this <cfset> references works fine and will
    work but repeats...
    <cfset ans1 = (qryGetPcts1.q1Ct / qryGetCounts.qID2) *
    100>
    <cfset ans2 = (qryGetPcts2.q2Ct / qryGetCounts.qID2) *
    100>
    <cfset ans3 = (qryGetPcts3.q3Ct / qryGetCounts.qID2) *
    100>
    <cfset ans4 = (qryGetPcts4.q4Ct / qryGetCounts.qID2) *
    100>
    <cfset ans5 = (qryGetPcts5.q5Ct / qryGetCounts.qID2) *
    100>
    So I'd like to loop and set them all instead...
    <cfloop index="i" from="1" to="27">
    <cfset ans#i# = (qryGetPcts#i#.q#i#Ct /
    qryGetCounts.qID2) * 100>
    </cfloop>
    But it's responding with this...
    Invalid CFML construct found on line 196 at column 19.
    ColdFusion was looking at the following text:
    I'm sure I'm missing something simple b/c this must be
    possible? Can I use a cfset in a loop?
    Help is appreciated

    In the main everything is in CF is in a struct. Armed with
    this information you use array notation to help you.
    <cfloop index="iCount" from="1" to="27">
    <cfset variables["ans" & iCount] =
    (variables["qryGetPcts" & iCount]["q" & iCount & "Ct"]
    / qryGetCounts.qID2) * 100>
    </cfloop>

  • Dynamic List - Error processing insertText tag: 'loop' parameter arrays must be...

    Hi, I'm using Dreamweaver CS3 and ADDT (PHP/MySQL).
    I have many forms that I created with "Create Dynamic List Wizard", and All it's working fine until now, suddendly when I enter an any form, click Application / Server Behaviors, I saw a red symbol "!" next to Dynamic List Layout, I clicked it in order to make any changes, and then when I tried to save I got the following error message:
    "Error processing insertText tag: 'loop' parameter arrays must be the same length. The 'loop' parameter 'tableCSSWidth' does not have the same length as the previous 'loop' parameter(s)."
    This is happening with others form in my application. I can made some changes through "code", but others no...
    I would like to know what its' happening with then "dynamic List" server behavior?
    I appreciate your help. Thanks!
    Ernesto

    Hello Ernesto,
    Please follow these exact steps:
    - go to this location on your disk (enable view of hidden files):
    - "c:\Documents and Settings\XP_user\Application Data\Adobe\Dreamweaver 9\Configuration"
    ( if you are on Windows OS)
    or:
    - "Macintosh HD:Users:MAC_User:Library:Application Support:Adobe:Dreamweaver 9:Configuration"
    ( if you are on MAC OSX)
    - rename the "Configuration" folder to "Configuration_old"
    - open Extension Manager and remove all extensions
    - install Developer Toolbox extension
    - start DW and check if the problem still occurs
    regards,
    Ionut

Maybe you are looking for

  • How do I show use poplist in uix pages?

    Ok here is my problem which I will try to relate it in HR schema example. I got a uix page showing departments and employees(one-many) master detail. I got another edit uix used to edit old employees or create new employees. In this edit/create uix I

  • Exception handling for TEXT_IO

    Hi, I am using TEXT_IO package in a report ver 6.0.8.26.0 to generate an extract. But, I am unable to handle exceptions like Invalid_Path, Invalid_Mode, Infalid_Filehandle, Invalid_operation, Write_Error, Fclose, etc. When I tried to to trap errors u

  • Info box

    when I want more information about a podcast I hit the i for information. But then the box won't go away, or move. It continues to block the center of my screen. How do I get rid of it?

  • 24bit iPod Mysteries

    Hi. I've known for a while now that iPods can't play 24bit files. I make music so all my music is exported or imported at 24bit. What I don't get is why iPods let you put 24bit music on them but they don't play??? I wouldn't mind if they saved you th

  • While running the cost : No valid source of supply could be found

    Hi Friends, When we have doing the  ck11n i got the this error meassge. No valid source of supply could be found , could u please give me clarification where i can fix this issue. Regards Mastan Reddy N