Trouble changing a class attribute in a STATEFULL bsp app - PLEASE HELP!!!!

hello, i have some trouble changing the value of a class attribute, in certain point of the execution of a statefull bsp app. The scenario is: the bsp app is on a url iview in a portal; i have some link in the portal, that do a window.open (pop up) of that app. the question is: how can i change the class attribute of the bsp app when i close that pop up?, if when i first click the link that show me the pop up, its doesn't create another instance of the class...i mean it continuing working with the same instance of the url iview in the portal. ANY help it will well received. Thanx in advance

hello Durairaj...yes indeed in the other thread thats the issue with the portal_version attribute, the person who create the iview dont want to change it...so i try to solve it with something else....thats bring me to another problem (posted in this thread). Now i have a question...in the url iview it calls a template that start the bsp app...i mean is not the url iview who calls the bsp app is a middle template...with this scenario can i pass the parameter sap-sessioncmd=open to the url iview or i have to pass it to the bsp app directly when in the middle template i call it??? another question when i pass that parameter via url, it create another instances (apart) of the class or restart the same instance that the app work with until that moment....tell me more about that parameter coz' i am new in bsp and i need help....i will give a lots of rewards point who help me!!! i promise....i am kind of desperade for sure....  thanx in advance

Similar Messages

  • Loosing application attribute in a statefull bsp app

    Hello guys,
    i have a little problem. I got a statefull bsp app that contain an application attribute that is loose between the oninit and the oninput...any ideas that could solve my problem? Thanx in advance

    Hi Mariana,
    I got (perhaps ?) a very similar problem just few minutes ago.
    In my OnInitialization event handler, I have :
    DATA: ta_usr01  TYPE TABLE OF usr01.
    SELECT * FROM usr01 UP TO 100 ROWS
             INTO TABLE ta_usr01.
    GET REFERENCE OF ta_usr01 INTO ta_data.
    where
    ta_data is declared as a page attribute TYPE REF TO DATA. 
    When I tried to dislay the data in the Layout, I observed in Debud that ta_data was like this :
    FREED STACK:{A:2*TYPE=%_T00004S00000072O0000002784}
    And then "Eurêka !" 
    It is because
    ta_data is pointing on a local variable (ta_usr01) which has long gone (since the end of OnInitialization event handler) 
    Everything went fine once I had declared ta_usr01 as a Page attribute (which means declared globally)
    I guess you experience the same kind of problem.
    Best regards,
    Guillaume

  • I'm in trouble to reset the security question answer of my apple id. while going to change no other option is showing without answering pane. please help.

    I'm in trouble to reset the security question answer of my apple id. while going to change no other option is showing without answering pane. please help.

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (118780)

  • My macbook Pro 13'' keys aren't working (The Esc, F1 to F12 and also the Eject Key doesn't work and so I'm unable to change the varied special features those keys offer.)  Please help what do i do? Because i've gone through all the support options :(

    My macbook Pro 13'' is giving me trouble
    The Esc, F1 to F12 and also the Eject Key doesn't work and so I'm unable to change the varied special features those keys offer.
    Please help what do i do?
    Bceause i've gone through all the support options

    Hi Kash_xo,
    If you are having an issue with some of the keys on your MacBook Pro's internal keyboard not functioning as expected, I would suggest that you troubleshoot using the steps in this article - 
    OS X Mavericks: If keys on your keyboard don’t work
    Thanks for using Apple Support Communities.
    Sincerely,
    Brett L 

  • HT5035 I had to change my id & have lost my gift card balance please help?

    I had to change my id & have lost my gift card balance please help?

    Did you change the Apple ID for an existing account? Or did you create a new Apple ID? If you created a new Apple ID, your balance will still be tied to the old account and you'll have to log into the iTunes Store using that old account to spend the balance. If you changed the ID on an existing account and can no longer see a credit balance, go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report the issue to the iTunes Store.
    Regards.

  • Hi! I have a problem. My macbook pro install all applications only in german( when i change language, it still install in german) This began from aperture 3, it was installed in german, than all apps.Please help.

    Hi! I have a problem. My macbook pro install all applications only in german( when i change language, it still install in german) This began from aperture 3, it was installed in german, than all apps.Please help.

    Hi! I have a problem. My macbook pro install all applications only in german( when i change language, it still install in german) This began from aperture 3, it was installed in german, than all apps.Please help.

  • I have two macbooks, one is my old one which my wife uses and my macbook pro.  When either of us make changes in Safari it changes it on the other's computer...please help.

    I have two macbooks, one is my old one which my wife uses and my macbook pro.  When either of us make changes in Safari it changes it on the other's computer...please help.

    You're both synchronizing Safari with iCloud while signed in with the same Apple ID. On one computer, sign out of iCloud in its preference pane and sign in with a different ID.

  • Language of some of my icons has changed and I can't seem to reverse it, please help!

    A friend of mine was messing around with my laptop and managed to change the language to what I believe to be Russian.  I changed the language under the 'International' tab back to English, but for some reason some of my icons (e.g. system preferences, software update and language menu) are still written in whatever language this is.  I've fiddled about with the settings in the 'International' tab for hours but with no success and I can't find a solution anywhere.  Please help!

    Did you do logout/login after moving English to the top of the list?
    Also you could try going to system prefs/international/language and using the Edit button to uncheck the box for Russian.

  • I'm in a java programming class and i'm stuck.. so please help me guys...

    Please help me, i really need help.
    Thanks a lot guys...
    this is my error:
    C:\Temp>java Lab2
    Welcome!
    This program computes the average, the
    exams
    The lowest acceptable score is 0 and th
    Please enter the minimum allowable scor
    Please enter the maximum allowable scor
    Was Exam1taken?
    Please Enter Y N or Q
    y
    Enter the Score for Exam1:
    65
    Was Exam2taken?
    Please Enter Y N or Q
    y
    Enter the Score for Exam2:
    32
    Was Exam3taken?
    Please Enter Y N or Q
    y
    Enter the Score for Exam3:
    65
    Was Exam4taken?
    Please Enter Y N or Q
    y
    Enter the Score for Exam4:
    32
    Was Exam5taken?
    Please Enter Y N or Q
    y
    Enter the Score for Exam5:
    32
    Score for Exam1 is:65
    Score for Exam2 is:32
    Score for Exam3 is:32
    Score for Exam4 is:32
    Score for Exam5 is:32
    the Minimum is:0
    the Maximum is:0
    Can't compute the Average
    Can't compute the Variance
    Can't compute the Standard Deviation
    this is my code:
    // Lab2.java
    // ICS 21 Fall 2002
    // Read in scores for a student's exams, compute statistics on them, and print out
    // the scores and statistics.
    public class Lab2
         // Create a manager for this task and put it to work
         public static void main(String[] args)
              ExamsManager taskManager = new ExamsManager();
              taskManager.createResults();
    // ExamsManager.java for Lab 2
    // ICS 21 Fall 2002
    // make these classes in the Java library available to this program.
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;
    import java.text.NumberFormat;
    // ExamsManager creates managers and contains the tools (methods) they need to do their
    // job: obtaining exam information, computing statistics and printing out that information
    class ExamsManager
         // INVALID_INT: special integer value to indicate that a non-integer
         // was entered when an integer was requested. It's chosen so as not to
         // conflict with other flags and valid integer values
         public static final int INVALID_INT = -9999;
         // valid user response constants:
         public static final String YES = "Y";               // user responded "yes"
         public static final String NO = "N";               // user responded "no"
         public static final String EXIT_PROGRAM = "Q";     // user responded "leave the program NOW"
         // INVALID_RESPONSE: special String value to indicate that something other than
         // "Y", "N" or "X" was entered when said was required
         public static final String INVALID_RESPONSE = "!";
         // ABSOLUTE_MIN_SCORE and ABSOLUTE_MAX_SCORE represent the smallest
         // minimum score and the largest maximum score allowed by the
         // program. (The allowable minimum and maximum for one
         // execution of the program may be different than these, but
         // they must both lie within this range.)
         public static final int ABSOLUTE_MIN_SCORE = 0;
         public static final int ABSOLUTE_MAX_SCORE = 1000;
         // The manager needs a place to store this student's exams
         private OneStudentsWork thisWork;
         // ...places to store the min and max scores allowed for these exams
         private int minAllowedScore;
         private int maxAllowedScore;
         // ...and a place to hold input coming from the keyboard
         BufferedReader console;
         //                    -------------------- Constructor --------------------
         // ExamsManager() make managers that delegate the major tasks of the program
         public ExamsManager()
         //                    -------------------- Processing methods --------------------
         // createResults() is the "manager at work": it calls assistants to welcome the user,
         // initializes things so we can read info from the keyboard,
         // obtain the minimum and maximum allowed scores,
         // obtain a student's work and comute the statistics on it and
         // print out the scores and the statistics
         public void createResults()
              // *** YOUR CODE GOES HERE ***
              printWelcomeMessage();
              readyKeyboard();
              obtainMinAndMaxAllowedScores();
              obtainOneStudentsWork();
              printResults();
         //                    -------------------- User input methods --------------------
         // readyKeyboard() sets up an input stream object 'console' connected to the keyboard
         // so that what's typed can be read into the program and processed.
         // Do not modify this code!
         private void readyKeyboard()
                   console = new BufferedReader(new InputStreamReader(System.in));
         // obtainMinAndMaxAllowedScores() asks the user to enter the minimum
         // and maximum allowable scores for this execution of the program.
         // Both the minimum and maximum allowable scores must be between
         // ABSOLUTE_MIN_SCORE and ABSOLUTE_MAX_SCORE (inclusive). This
         // method should continue to ask the user for a minimum until a
         // valid one is entered (or EXIT_PROGRAM is entered), then continue
         // to ask the user for a maximum until a valid one is entered. If
         // the minimum entered is greater than the maximum entered, the
         // whole thing should be done again.
         public void obtainMinAndMaxAllowedScores()
              // *** YOUR CODE GOES HERE ***
              int response = INVALID_INT;
              if (response >= minAllowedScore && response <= maxAllowedScore)
                   System.out.print("Please enter the minimum allowable score:");
                   response = getIntOrExit();
              while (response > maxAllowedScore || response < minAllowedScore)
                   System.out.print("Please enter the minimum allowable score:");
                   response = getIntOrExit();
              if (response <= ABSOLUTE_MAX_SCORE && response >= ABSOLUTE_MIN_SCORE)
                   System.out.print("Please enter the maximum allowable score:");
                   response = getIntOrExit();
              while (response > ABSOLUTE_MAX_SCORE || response < ABSOLUTE_MIN_SCORE)
                   System.out.print("Please enter the maximum allowable score:");
                   response = getIntOrExit();
              /*int response;
              String allowedMin;
              boolean done = true;
              do
                   done = true;
                   System.out.print("Please enter the minimum allowable score:");
                   response = getIntOrExit();
                   allowedMin = getYNOrExit();
                   if(allowedMin == EXIT_PROGRAM)
                        System.exit(0);
                   else if (response >= ABSOLUTE_MIN_SCORE)
                        done = true;
                   else if (response >= ABSOLUTE_MAX_SCORE)
                        done = false;
                        System.out.println("INVALID: " + INVALID_INT);
                        System.out.print("Please enter the minimum allowable score:");
                        response = getIntOrExit();
              }while (!done);
    /*          System.out.print("Please enter the maximum allowable score:");
              response = getIntOrExit();
              if (response <= ABSOLUTE_MAX_SCORE)
              return response;
              else if (response <= ABSOLUTE_MIN_SCORE)
                   response = INVALID_INT;
              while (response == INVALID_INT)
                   System.out.print("Please enter the maximum allowable score:");
                   response = getIntOrExit();
              do
                   done = true;
                   System.out.print("Please enter the minimum allowable score:");
                   response = getIntOrExit();
                   String allowedMax;
                   if(allowedMin == EXIT_PROGRAM)
                        System.exit(0);
                   if (response <= ABSOLUTE_MAX_SCORE)
                        done = true;
                   else if (response <= ABSOLUTE_MIN_SCORE)
                        done = false;
                        System.out.println("INVALID: " + INVALID_INT);
                        System.out.print("Please enter the maximum allowable score:");
                        response = getIntOrExit();
              }while (!done);
         // The overall strategy to building up a student work object is
         // to have the student-bulding method call on the exam-building
         // method, which calls upon user input methods to get exam info.
         // Thus, user entered info is successively grouped together
         // into bigger units to build the entire student information set.
         // obtainOneStudentsWork() builds the five exams
         // and constructs the student work object from them
         private void obtainOneStudentsWork()
              // *** YOUR CODE GOES HERE ***
              int index = 1;
              Exam exam1 = buildOneExam(index);
              index = 2;
              Exam exam2 = buildOneExam(index);
              index = 3;
              Exam exam3 = buildOneExam(index);
              index = 4;
              Exam exam4 = buildOneExam(index);
              index = 5;
              Exam exam5 = buildOneExam(index);
              thisWork = new OneStudentsWork(exam1, exam2, exam3, exam4, exam5);
         // buildOneExam(thisTest) reads the exam information for one exam and returns an
         // Exam object constructed from this information. Uses obtainWasExamTaken() to
         // determine if the exam was taken and obtainOneScore() to get the exam score, if needed.
         private Exam buildOneExam(int thisTest)
              // *** YOUR CODE GOES HERE ***
              int score = 0;
              if(obtainWasExamTaken(thisTest))
                   score = obtainOneScore(thisTest);
              return new Exam(score);
              else
              return new Exam();
              System.out.println("Enter score for exam1:");
              Exam exam1 = new Exam(getIntOrExit());
              System.out.println("Enter score for exam2:");
              Exam exam2 = new Exam(getIntOrExit());
              System.out.println("Enter score for exam3:");
              Exam exam3 = new Exam(getIntOrExit());
              System.out.println("Enter score for exam4:");
              Exam exam4 = new Exam(getIntOrExit());
              System.out.println("Enter score for exam5:");
              Exam exam5 = new Exam(getIntOrExit());
         // obtainWasExamTaken(thisTest) keeps asking the user whether 'thisTest' was taken
         // (e.g., "Was exam 1 taken? Enter Y, N or Q", if thisTest equals 1)
         // until s/he provides a valid response. If Q is entered, we leave the
         // program immediately; if Y or N (yes or no), return true if yes, false if no
         private boolean obtainWasExamTaken(int thisTest)
              // *** YOUR CODE GOES HERE ***
              String response = INVALID_RESPONSE;
              System.out.println("Was Exam" + thisTest + "taken?");
              while (response.equals(INVALID_RESPONSE))
                   System.out.println("Please Enter" + " " + YES + " " + NO + " " + "or" + " " + EXIT_PROGRAM);
                   response = getYNOrExit();
              if (response.equals(YES))
              return true;
              else
              return false;
         // obtainOneScore(thisTest) keeps asking the user to enter a score for
         // 'thisTest' (e.g., "Enter the score for exam 1", is thisTest equals 1)
         // until s/he provides one within range or s/he tells us to exit the program.
         private int obtainOneScore(int thisTest)
              // *** YOUR CODE GOES HERE ***
              int response = INVALID_INT;
              if (response >= minAllowedScore && response <= maxAllowedScore);
                   System.out.println("Enter the Score for Exam" + thisTest + ":");
                   response = getIntOrExit();
              while (response > ABSOLUTE_MAX_SCORE || response < ABSOLUTE_MIN_SCORE)
                   System.out.println("INVALID: " + INVALID_INT);
                   System.out.println("Please Enter again:");
                   response = getIntOrExit();
              return response;
         // scoreIsWithinRange() returns true if the given score is inside of
         // the allowable range and false if it is out of range
         private boolean scoreIsWithinRange(int score)
              // *** YOUR CODE GOES HERE ***
              if (score >= minAllowedScore && score <= maxAllowedScore)
                   return true;
              else
                   return false;
         // getYNQ() reads a String from the console and returns it
         // if it is "Y" or "N" or exits the program if "Q" is entered;
         // the method returns INVALID_RESPONSE if the response is other
         // than"Y", "N" or "Q".
         // Do not modify this code!
         private String getYNOrExit()
              String usersInput = INVALID_RESPONSE;
              try
                   usersInput = console.readLine();
              catch (IOException e)
                   // never happens with the keyboard...
              usersInput = usersInput.toUpperCase();
              if (usersInput.equals(EXIT_PROGRAM))
                   System.out.println("Leaving...");
                   System.exit(0);
              if (usersInput.equals(YES) || usersInput.equals(NO))
                   return usersInput;
              else
                   return INVALID_RESPONSE;
         // getIntOrExit() reads an integer from the console and returns it.
         // If the user types in "Q", the program exits. If an integer is entered,
         // it is returned. If something that is not an integer (e.g. "Alex"), the
         // program returns INVALID_INT
         // Do not modify this code!
         private int getIntOrExit()
              String usersInput = "";
              int theInteger = 0;
              try
                   usersInput = console.readLine();
              catch (IOException e)
                   // never happens with the keyboard...
              // if the user wants to quit, bail out now!
              if(usersInput.toUpperCase().equals(EXIT_PROGRAM))
                   System.out.println("Program halting at your request.");
                   System.exit(0);
              // see if we have an integer
              try
                   theInteger = Integer.parseInt(usersInput);
              catch (NumberFormatException e)
                   // user's input was not an integer
                   return INVALID_INT;
              return theInteger;
         //                    -------------------- User output methods --------------------
         // printWelcomeMessage() prints a welcome message to the user explaining
         // what the program does and what it expects the user to do. In
         // particular, it needs to tell the user the absolute lowest and
         // highest acceptable exam scores
         private void printWelcomeMessage()
              // *** YOUR CODE GOES HERE ***
              System.out.println("Welcome!");
              System.out.println("This program computes the average, the variance, and the standard deviation of 5 exams");
              System.out.println("The lowest acceptable score is 0 and the highest is 1000");
         // printResults() prints all of the scores present, then prints the
         // statistics about them. The statistics that can have factional parts
         // -- average, variance and standard deviation -- should be printed with
         // exactly three digits after the decimal point. If a statistic could not be
         // computed, a message to that effect should print (NOT the "phony" value stored
         // in the statistic to tell the program that the statistic could not be computed).
         public void printResults()
              // These statements create a NumberFormat object, which is part
              // of the Java library. NumberFormat objects know how to take
              // doubles and turn them into Strings, formatted in a particular
              // way. First, you tell the NumberFormat object (nf) how you'd like
              // the doubles to be formatted (in this case, with exactly 3
              // digits after the decimal point). When printing a double you call
              // format to format it -- e.g. nf.format(the-number-to-format)
              NumberFormat nf = NumberFormat.getInstance();
              nf.setMinimumFractionDigits(3);
              nf.setMaximumFractionDigits(3);
              // *** YOUR CODE GOES HERE ***
              System.out.println("Score for Exam1 is:" + thisWork.getExam1().getScore());
              System.out.println("Score for Exam2 is:" + thisWork.getExam2().getScore());
              System.out.println("Score for Exam3 is:" + thisWork.getExam3().getScore());
              System.out.println("Score for Exam4 is:" + thisWork.getExam4().getScore());
              System.out.println("Score for Exam5 is:" + thisWork.getExam5().getScore());
              if (thisWork.getStatistics().getMinimum() == Statistics.CANT_COMPUTE_STATISTIC)
                   System.out.println("Can't compute the Minimum");
              else
                   System.out.println("the Minimum is:" + thisWork.getStatistics().getMinimum());
              if (thisWork.getStatistics().getMaximum() == Statistics.CANT_COMPUTE_STATISTIC)
                   System.out.println("Can't compute the Minimum");
              else
                   System.out.println("the Maximum is:" + thisWork.getStatistics().getMaximum());
              if (thisWork.getStatistics().getAverage() == Statistics.CANT_COMPUTE_STATISTIC)
                   System.out.println("Can't compute the Average");
              else
                   System.out.println("the Average is:" + thisWork.getStatistics().getAverage());
              if (thisWork.getStatistics().getVariance() == Statistics.CANT_COMPUTE_STATISTIC)
                   System.out.println("Can't compute the Variance");
              else
                   System.out.println("the Variance is:" + thisWork.getStatistics().getVariance());
              if (thisWork.getStatistics().getStandardDeviation() == Statistics.CANT_COMPUTE_STATISTIC)
                   System.out.println("Can't compute the Standard Deviation");
              else
                   System.out.println("the Standard Deviation is:" + thisWork.getStatistics().getStandardDeviation());
    // OneStudentsExams.java for Lab 2
    // ICS 21 Fall 2002
    // OneStudentsWork is the exams and the statistics computed from
    // them that comprise one student's work
    class OneStudentsWork
         public static final int NUMBER_OF_EXAMS = 5;
         // The student is offered five exams...
         private Exam exam1;
         private Exam exam2;
         private Exam exam3;
         private Exam exam4;
         private Exam exam5;
         // The statistics on those exams
         Statistics studentStats;
         //                    -------------------- Constructor --------------------
         // Takes five constructed exam objects and store them for this student.
         // Constructs a statistics object that holds the stats for these exams and
         // store it in studentStats.
         public OneStudentsWork(Exam test1, Exam test2, Exam test3, Exam test4, Exam test5)
              // *** YOUR CODE GOES HERE ***
              exam1 = test1;
              exam2 = test2;
              exam3 = test2;
              exam4 = test4;
              exam5 = test5;
              studentStats = new Statistics(test1, test2, test3, test4, test5);
         //                    -------------------- Accessor methods --------------------
         // getExamX() methods make available ExamX
         public Exam getExam1()
              return exam1;
         public Exam getExam2()
              return exam2;
         public Exam getExam3()
              return exam3;
         public Exam getExam4()
              return exam4;
         public Exam getExam5()
              return exam5;
         // getStatistics() makes available the Statistics object that is part of this student's work
         public Statistics getStatistics()
              return studentStats;
    // Statistics.java for Lab 2
    // ICS 21 Fall 2002
    // A Statistics object stores the statistics for a group of Exams.
    class Statistics
         // This constant denotes a statistic that cannot be
         // computed, such as an average of zero scores or a variance
         // of one score.
         public static final int CANT_COMPUTE_STATISTIC = -9999;
         // The stats
         private int minimum;
         private int maximum;
         private int numberOfExamsTaken;
         private double average;
         private double variance;
         private double standardDeviation;
         //                    -------------------- Constructor --------------------
         // Calculates (initializes) the statistics, using passed-in exams.
         // Note that the order of computing thst stats matters, as some
         // stats use others; for instance, variance must be computed before
         // standard deviation.
         public Statistics(Exam exam1, Exam exam2, Exam exam3, Exam exam4, Exam exam5)
              // *** YOUR CODE GOES HERE ***
              calculateAverage(exam1,exam2,exam3,exam4,exam5);
              calculateVariance(exam1,exam2,exam3,exam4,exam5);
              calculateStandardDeviation(exam1,exam2,exam3,exam4,exam5);
         //                    -------------------- Accessor methods --------------------
         // getNumberOfExamsTaken() makes available the number of exams this student undertook
         public int getNumberOfExamsTaken()
              return numberOfExamsTaken;
         // getMinimum() makes the minimum available
         public int getMinimum()
              return minimum;
         // getMaximum() makes the maximum available
         public int getMaximum()
              return maximum;
         // getAverage() makes the average available
         public double getAverage()
              return average;
         // getVariance() make the variance available
         public double getVariance()
              return variance;
         // getStandardDeviation() make the standard deviation available
         public double getStandardDeviation()
              return standardDeviation;
         //                    -------------------- Statistics methods --------------------
         //     ---> Note: all statistics are to be computed using the number of exams taken
         // calculateNumberOfExamsTaken() computes the number of tests the student took
         // and stores the result in 'numberOfExamsTaken'
         // (Note this statistic can always be computed.)
         private void calculateNumberOfExamsTaken(Exam exam1, Exam exam2, Exam exam3, Exam exam4, Exam exam5)
              // *** YOUR CODE GOES HERE ***
              numberOfExamsTaken = OneStudentsWork.NUMBER_OF_EXAMS;
         // calculateMinimum() sets 'minimum' to the minimum score of exams taken, or
         // to CANT_COMPUTE_STATISTIC if a minimum can't be computed.
         private void calculateMinimum(Exam exam1, Exam exam2, Exam exam3, Exam exam4, Exam exam5)
              // *** YOUR CODE GOES HERE ***
              /*min = exam1.getScore();
              if (min > exam2.getScore())
                   min = exam2.getScore();
              if (min > exam3.getScore())
                   min = exam3.getScore();
              if (min > exam4.getScore())
                   min = exam4.getScore();
              if (min > exam5.getScore())
                   min = exam5.getScore();
              if(numberOfExamsTaken == 0)
                   minimum = CANT_COMPUTE_STATISTIC;
              else if(numberOfExamsTaken == 1)
                   minimum = exam1.getScore();
              else
                   minimum = exam1.getScore();
                   if(numberOfExamsTaken >= 2 && numberOfExamsTaken <= minimum)
                        minimum = exam2.getScore();
                   if(numberOfExamsTaken >= 3 && numberOfExamsTaken <= minimum)
                        minimum = exam3.getScore();
                   if(numberOfExamsTaken >= 4 && numberOfExamsTaken <= minimum)
                        minimum = exam4.getScore();
                   if(numberOfExamsTaken >= 5 && numberOfExamsTaken <= minimum)
                        minimum = exam5.getScore();
              if (getMinimum() == ExamsManager.ABSOLUTE_MIN_SCORE)
                   minimum = exam1.getScore();
                   //exam1.getScore() = getMinimum();
              else
                   exam1.getScore() = CANT_COMPUTE_STATISTIC;
         // calculateMaximum() sets 'maximum' to the maximum score of exams taken, or
         // to CANT_COMPUTE_STATISTIC if a maximum can't be computed.
         private void calculateMaximum(Exam exam1, Exam exam2, Exam exam3, Exam exam4, Exam exam5)
              // *** YOUR CODE GOES HERE ***
              /*if (maximum == ExamsManager.ABSOLUTE_MAX_SCORE)
              return true;
              else
              return CANT_COMPUTE_STATISTIC;*/
              max = exam1.getScore();
              if (max < exam2.getScore())
                   max = exam2.getScore();
              if (max < exam3.getScore())
                   max = exam3.getScore();
              if (max < exam4.getScore())
                   max = exam4.getScore();
              if (max < exam5.getScore())
                   max = exam5.getScore();
              if(numberOfExamsTaken == 0)
                   maximum = CANT_COMPUTE_STATISTIC;
              else if(numberOfExamsTaken == 1)
                   maximum = exam1.getScore();
              else
                   maximum = exam1.getScore();
                   if(numberOfExamsTaken >= 2 && numberOfExamsTaken >= maximum)
                        maximum = exam2.getScore();
                   if(numberOfExamsTaken >= 3 && numberOfExamsTaken >= maximum)
                        maximum = exam3.getScore();
                   if(numberOfExamsTaken >= 4 && numberOfExamsTaken >= maximum)
                        maximum = exam4.getScore();
                   if(numberOfExamsTaken >= 5 && numberOfExamsTaken >= maximum)
                        maximum = exam5.getScore();
         // calculateAverage() computes the average of the scores for exams taken and
         // stores the result in 'average'. Set to CANT_COMPUTE_STATISTIC if there
         // are no tests taken.
         private void calculateAverage(Exam exam1, Exam exam2, Exam exam3, Exam exam4, Exam exam5)
              // *** YOUR CODE GOES HERE ***
              if (numberOfExamsTaken == 5)
                   average = (exam1.getScore()+exam2.getScore()+exam3.getScore()+exam4.getScore()+exam5.getScore()/OneStudentsWork.NUMBER_OF_EXAMS);
              else if (numberOfExamsTaken == 4)
                   average = (exam1.getScore()+exam2.getScore()+exam3.getScore()+exam4.getScore()/OneStudentsWork.NUMBER_OF_EXAMS);
              else if (numberOfExamsTaken == 3)
                   average = (exam1.getScore()+exam2.getScore()+exam3.getScore()/OneStudentsWork.NUMBER_OF_EXAMS);
              else if (numberOfExamsTaken == 2)
                   average = (exam1.getScore()+exam2.getScore()/OneStudentsWork.NUMBER_OF_EXAMS);
              else if (numberOfExamsTaken == 1)
                   average = (exam1.getScore()/OneStudentsWork.NUMBER_OF_EXAMS);
              else if (numberOfExamsTaken == 0)
                   average = CANT_COMPUTE_STATISTIC;
         // calculateVariance() calculates the returns the variance of the
         // scores for exams taken and stores it in 'variance'
         // For a small set of data (such as this one), the formula for calculating variance is
         // the sum of ((exam score - average) squared) for scores of exams taken
         // divided by (the number of scores - 1)
         // Set to CANT_COMPUTE_STATISTIC if there are fewer than two tests taken.
         private void calculateVariance(Exam exam1, Exam exam2, Exam exam3, Exam exam4, Exam exam5)
              // *** YOUR CODE GOES HERE ***
              if (numberOfExamsTaken == 5)
                   variance = ((exam1.getScore()-average)*(exam1.getScore()-average)+(exam2.getScore()-average)*(exam2.getScore()-average)+(exam3.getScore()-average)*(exam3.getScore()-average)+(exam4.getScore()-average)*(exam4.getScore()-average)+(exam5.getScore()-average)*(exam5.getScore()-average))/4;
              else if (numberOfExamsTaken == 4)
                   variance = ((exam1.getScore()-average)*(exam1.getScore()-average)+(exam2.getScore()-average)*(exam2.getScore()-average)+(exam3.getScore()-average)*(exam3.getScore()-average)+(exam4.getScore()-average)*(exam4.getScore()-average))/4;
              else if (numberOfExamsTaken == 3)
                   variance = ((exam1.getScore()-average)*(exam1.getScore()-average)+(exam2.getScore()-average)*(exam2.getScore()-average)+(exam3.getScore()-average)*(exam3.getScore()-average))/4;
              else if (numberOfExamsTaken == 2)
                   variance = ((exam1.getScore()-average)*(exam1.getScore()-average)+(exam2.getScore()-average)*(exam2.getScore()-average))/4;
              else if (numberOfExamsTaken < 2)
                   variance = CANT_COMPUTE_STATISTIC;
         // calculateStandardDeviation() calculates the standard
         // deviation of the scores of taken exams and stores
         // it in 'standardDeviation'
         // The formula for calculating standard deviation is just
         // the square root of the variance
         private void calculateStandardDeviation(Exam exam1, Exam exam2, Exam exam3, Exam exam4, Exam exam5)
              // *** YOUR CODE GOES HERE ***
              if (variance == CANT_COMPUTE_STATISTIC)
                   standardDeviation = CANT_COMPUTE_STATISTIC;
              else
                   standardDeviation = (Math.sqrt(variance));
    // Exam.java for Lab 2
    // ICS 21 Fall 2002
    // An Exam object stores information about one exam
    class Exam
         private boolean examTaken;     //was the exam taken? true for yes, false for no
         private int score;               //the exam's score; = 0 if test not taken
         //                    -------------------- Constructors --------------------
         // Construct a taken exam; it has score 's'
         public Exam(int s)
              score = s;
              examTaken = true;
         // Construct an exam not taken; it has a score of 0
         public Exam()
              score = 0;
              examTaken = false;
         //                    -------------------- Accessor methods --------------------
         // Make the score of an exam available
         public int getScore()
              return score;
         // Make available whether an exam was taken
         public boolean wasTaken()
              return examTaken;

    Your code is absolutely unreadable - even if someone was willing to
    help, it's simply impossible. I do give you a few tips, though: If you
    understand your code (i.e. if it really is YOUR code), you should be
    able to realize that your minimum and maximum never get set (thus they
    are both 0) and your exam 3 is set with the wrong value. SEE where
    those should get set and figure out why they're not. Chances are you
    are doing something to them that makes one 'if' fail or you just
    erroneously assign a wrong variable!

  • I got a new e-mail address and I reset my iPod so it already has the new email address. I can't seem to change the address on my iPad or iPhone. Please help me change the address on all my devices!

    I got a new email address and I reset the iPod so it already has the new address. I can't seem to change the address on my iPhone5 or iPad. So please help! How do I change the address for my apple ID and icloud on all my devices? I don't want to reset my iPad and phone just to set new email address I can't do updates without the password and I have forgotten my password for my old email address. Please Help! Getting frustarted!

    If the old ID ("email address") is yours, and if your current ID was created by editing the details of this old ID (rather than being an entirely new ID), go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • ALL SHAPES LAYERS SUDDENLY CHANGED COLOR WITH SOME ACCIDENTALLY USED KEYBOARD SHORT CUT PLEASE HELP

    I was working away in photoshop on an INCREDIBLY important file and suddenly all of my shape layers inverted... there is NOTHING in the history and I have literally tried everything I can think of. this is seriously a crucial issue and i really need this to be fixed. if ANYONE knows anything please help. I'm posting a screenshot of what it looked like and what it looks like now. naturally adobe wont let me call them or do ANYTHING to get immediate help with this absolutely infuriating problem so if someone out there could help that would be great. SERIOUSLY regretting using photoshop, it is so infuriating even after 7 years of using it.
    ^^ this is what the colors looked like
    and VV this is what they look like now. as far as i can tell, its only the shape layers that have changed color. I have tried everything and nothing works.
    roughly, all the yellow turned green and all the red and white turned black? I have no idea. please PLEASE someone help me.

    The colors are present even when  I exported Jpegs from the photoshop file. Gamut warning is off. the difficult thing with screenshots is that the image appears in different colors at different sizes... which is bizzare.. at the full shape, some of the shape layers appear fine as pictured below
    and then when i zoom in this happens

  • With my daughters i Pod Touch, we think someone hacked our account and changed the resuce email, and security question answers.  Please HELP!!!  Nelson Williams

    I think my daughters account was hacked and the resuce email and the security questions were changed.  PLEASE HELP
    Many Thanks,
    Alex

    All you can do is contact iTunes:
    Contact iTunes

  • My iPod 5th Generation won't let me log into my FaceTime account or iMessage. Ever since I downloaded IOS7. I already tried changing my password and that didn't work. Please help

    My iPod 5th Generation won't let me log into my FaceTime account or iMessage. Ever since I downloaded IOS7. I already tried changing my password and that didn't work. Please help

    iOS: Troubleshooting FaceTime and iMessage activation
    FaceTime, Game Center, Messages: Troubleshooting sign in issues

  • Detecting changes in class attributes

    Hi,
    I am trying to find the best way to do the following.
    I have a class that has multiple attributes which can be access via getters and setters. I would like to persist this object in LDAP (I have my reasons) and would like to only persist the changes. Now I would like to do a Hibernate like service, where you define the attributes etc and then access them via the class, but I would like to be able to detect when a change has been made to the attributes and only persist those changes.
    Is this possible to do? I was thinking using AOP to insert rules on the attributes at runtime and add a Map that contained the original and new value and what the change actually was i.e update, delete, add and then write the update as required.
    This is mainly for 1.4.x

    No, what I am trying to do is this.
    I have a class that I know the fields I want to track / monitor for changes, and then have a method that I can call to find out if the class is 'dirty' i.e. there has been a change to one or more of the fields I am tracking / monitoring.
    Once I know the class is dirty (it has been updated) I want to find out those fields that have changed and make a modification / addition / deletion request.
    I think AOP is the way to go, but I am not sure.....
    This is not for new object that I am not aware of, as the data has not been persisted yet. This is for new objects I construct and return to the user.
    Message was edited by:
    nirving

  • Retain variables and application class attributes in a statless bsp..

    hello experts,
    i need to transform a bsp page from stateful mode to stateless but there is a link in the page and the content changes when clicked on the link. when statefull there is no problem cause i can keep the parameters in various ways but i need to find a way to retain those variables in stateless mode as well. is there any way to do this??
    replies appreciated,
    thanks..

    do you mean server side cookies using class cl_bsp_server_side_cookie didnt help. i use it in all my stateless apps without any problem. may be if you could explain the flow of app/data and show us your code using cl_bsp_server_side_cookie=>set_server_cookie we may be able to check out whats going wrong.
    Raja

Maybe you are looking for