Int question

what is meant by up stream and down stream clients

Hello,
Software Configuration Management and Lifecycle Management Development of software for large enterprises is a growing challenge. On one side the software is com-plex due to variety of real life situations that need to be handled and on the other hand, software devel-opment is manpower intensive. Typical development of enterprise strength software involves hundreds of developers working together. More complex software development would mean groups of developers working together to develop smaller pieces of software that participate in a “stream” of development where the development groups “downstream” use the software created by groups “upstream.” Further more, the downstream groups can be dependent on many upstream developments. Quickly this leads to a huge dependency among the software parts being developed that finally explodes during integration test-ing and creation of software for final deployment.
See this doc for more info
[Features of the SAP NetWeaver Development Infrastructure|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8a74199b-0701-0010-07a1-ebb5adafe2b1]
Thanks
Chandran

Similar Messages

  • Pricing int.Question

    Hi,
    In one int. i faced this question. Business is selling Mobils.So if customer comes in BMW  discount is 5%,if he comes in BENZ  discount is 7%,if he comes in AUDI discount is 3%. how should i get this.
    Thanks u in Advance.
    byard

    hello and good morning, friend.
    to define condition groups go to IMG > LOGISTICS GENERAL > BUSINESS PARTNERS > CUSTOMERS > Define Condition Groups.  you then make new entries here.  you can make the following entries, for example:
    z1   BMW
    z2   Mercedes
    z3   Audi
    when you create or change a sales order, you will already see your entries when you select a line item and GO TO > ITEM > MORE FUNCTIONS > ADDITIONAL DATA A and looking at the drop down from Condition groups 1 to 5.
    the next step is to include the condition groups field in your access sequence.  you will see that the condition groups 1 to 5 (KDKG1 to KDKG5) are already allowable fields.  you use, create or copy a condition table that has the condition group as a pricing variable.  for this to  be effective, you have to choose from condition groups 1 to 5.
    you then include this table in your access sequence.  the access sequence is assigned to your condition type.
    now do VK11 for the condition type.   the system will now allow you to define discounts based on condition group.  remember to use the same condition group that you defined in your condition table.  you can make entries, for example:
    z1   5%
    z2   7%
    z3   3%.
    when you create your sales order, enter the value z1, z2 or z3 in the Condition Groups field.  check your pricing.
    hope this helped.
    regards.
    thanks for the points.  you have been very generous.

  • Integer static valueOf(int) question

    Hi there.
    Im wondering is it at all possible for an Integer reference variable to be returned
    a null by invoking this method from the API:
    Integer myInt = Integer.valueOf(//some int);The reason I am asking this question is that my SCJP book asks a question
    about using a method that is similar to the following:
    class BankAccount {
    private Map<String, Integer> accountFunds = new HashMap<String, Integer>();
    public int customerBalance(String custAccount) {
       return accountFunds.get(custAccount);
    public void setCustomerBalance(String custAccount, int balance) {
       accountFunds.put(custAccount, Integer.valueOf(balance));
    }Looking at the single return statement in the customerBalance method, my book states that this is inappropriate
    because a null cant unbox to 0 I disagree because if you look at the setCustomerBalance method you are putting an Integer
    instance that is initialized with an int primitive into the Map. So how could it be possible to have
    a null Integer instance in the map if you pass an int primitive to the valueOf method? I can understand
    if you were using a String to instantiate the Integer, and you passed null, that you would get a NumberFormatException or something like that, but about you are using a primitive, not an Object.
    Any clarification greatly received,
    Thanks & best regards.

    I disagree because if you look at the setCustomerBalance method you are putting an Integer
    instance that is initialized with an int primitive into the Map.And what happens if you call customerBalance() (which should really be named getCustomerBalance()) with a customer ID that doesn't exist?

  • Formatting int question : 1 to 1st , 2 to 2nd, etc.

    I have a database column containing numerics 1 to 9. I'd like to display 1st, 2nd, 3rd, etc. to the user. I can perform this with some code, but is there a better way to format a number like this?
    Thanks,
    Mike

    . I can perform this with some code, but is there a
    better way to format a number like this?Not unless you can find a 3rd-party library that does this. I think there might be libraries available to format numbers like 123 into "One hundred twenty three", but I'd be less inclined to believe there are ones to do what you're after.

  • Some int questions;; need answers

    what is the difference between BI and BW?
    what type of scheduler u have used in loading data?
    wat tool u r using for client support (to resolve queries)?
    what type of errors u come accross in support? example one real instance
    please provide answers
    bw job seeker

    Ramakrishna,
    Check the below...
    what is the difference between BI and BW?
    BW is called as BI in Netweaver 2004 and 2004's..
    what type of scheduler u have used in loading data?
    The ques is not clear...
    wat tool u r using for client support (to resolve queries)?
    There are CRM tools like Vantiff, remedy used for client support.
    what type of errors u come accross in support? example one real instance
    Error while activating data in ODS object....

  • Good inteview  Question?

    hi ,
      Plz give good int questions on bdc with answers...
    regards

    Hi Deepak,
    What is BDC- its use, and how to use it?
    It is Batch Data conversion used for transferring some data other than sap into sap ... this is also a work of an ABAPer.
    What is "UTS" Or may be it is "UST", something called Unit test?
    Use:  After developing any object we should write a test case proving that the object is working properly or not.  This is done by the ABAPer. This is UNIT TEST CASE.
    In BDC how can we handle Table Controls?
    When you do your recording you will have a tab for Next line or Insert. You have to capture that in your recording. If your transaction code doesn't have that in the recording then you have to set up a page down (=P+) and loop it based on the line entries u c on teh screen. 
    Suppose we are transfer data through BDC from leagacy to SAP and their is some duplicate data in legacy system but we don't want this in SAP system .So how can we check that this data is already exist? 
    In BDC you would have all your legacy data in an internal table. Use Delete Adjacent dulpicates syntax to delete duplicate entries.
    Can we use two transaction code in one BDC like XK01 & XD01 if yes how?
    Yes, we can do that by combining the two bdc program codes together.  Then you perform the program routine accordingly.  However, it will make your BDC program very long and complex.
    How can we handle errors in Function Module?
    Exceptions is used to handle errors.
    Can we use Session method & Call transaction both in one BDC if yes please give me example and scenerio where we use this?
    You start your dataload using Call Transaction and if any errors occur push all those errors in a session so that your dataload takes place uninterrupted and you can processs ur errors later.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Can't get to the next question...

    Hello,
    I am brand new to programming and Java and am trying to teach myself. Seems like an imposible task however I'm giving it a shot. I am trying to create a simple menu selection
    quiz program to choose between topic and answer questions. This is what I have so far and
    I'm not sure how to get to the next question. Can anyone give me any assistance please?
    Thank you,
    Mark
    Here is what I have so far:
    import java.util.Scanner;
    class Quiz {
        public static void main(String args[])
              throws java.io.IOException {
              char choice;
              char quit = 'x';
              int questions = 1;
              int number;
              System.out.println("     Welcome to the Quick Quiz program!!!\n ");
              System.out.println("     Would you like to try the Math, Science or Art Quiz?\n ");
              System.out.println("     m > for math ");
              System.out.println("     s > for science ");
              System.out.println("     a > for art\n ");
              System.out.println("     or Hit x to Exit ");
              choice =(char) System.in.read();
            System.out.println("\n");
              switch(choice) {
                   case 'm':
                     System.out.println("  Here comes the math quiz>>>\n");
                        System.out.println("  Question 1. What is 3 + 3?");
                     System.out.println("     a) 9\n     b) 3\n     c) 33\n     d) 6 ");
                     System.out.println("  Choose one (x to EXIT)\n");
                      choice =(char) System.in.read();
                  if (choice == 'd') {
                         System.out.println("  Correct!! " );
                   } else if (choice == 'a' || choice == 'b' || choice == 'c') {
                            System.out.println("  Sorry, Wrong Answer\n\n");
                               System.out.println("  Next Question");
                               System.out.println("  Question 2. What is 15 x 2?");
                               System.out.println("     a) 9\n     b) 3\n     c) 33\n     d) 6 ");
                          }}}

    I really appreciate your help but I guess I am still just a little too green, Would there be any way you could just give me some kind of outline on how to do that? My biggest problem is where to put everything. I'm only looking to try and get 5 questions to work for now. I know that I need to use the System.in.read(); statement to keep prompting the quiz taker after each question. I think I got a little further now.
    Thank you,
    Mark
    import java.util.Scanner;
    class Quiz {
        public static void main(String args[])
              throws java.io.IOException {
              char choice;
              char quit = 'x';
              int questions = 1;
              int number;
              System.out.println("   \nWelcome to the Quick Quiz program!!!\n ");
              System.out.println("     Would you like to try the Math, Science or Art Quiz?\n ");
              System.out.println("     m > for math ");
              System.out.println("     s > for science ");
              System.out.println("     a > for art\n ");
              System.out.println("     or Hit x to Exit ");
              choice =(char) System.in.read(); System.in.read
            System.out.println("\n");
              switch(choice) {
                   case 'x':
                      System.out.println("  Sorry to see you go, Good Bye!!!");
                      break;
            switch(choice) {
                   case 'm':
                     System.out.println("  Here comes the math quiz>>>\n");
                        System.out.println("  Question 1. What is 3 + 3?");
                     System.out.println("     a) 9\n     b) 3\n     c) 33\n     d) 6 ");
                     System.out.println("  Choose one (x to EXIT)\n");
                                   do {
                                     choice =(char) System.in.read();
                      } while (choice == '\n' || choice == '\r');
                  if (choice == 'd') {
                         System.out.println("  Correct!! " );
                   } else if (choice == 'a' || choice == 'b' || choice == 'c') {
                            System.out.println("  Sorry, Wrong Answer\n\n");
                            System.out.println("  Next Question");
                               System.out.println("  Question 2. What is 15 x 2?");
                               System.out.println("     a) 13\n     b) 30\n     c) 17\n     d) 60 ");
                           do {
                                     choice =(char) System.in.read();
                      } while (choice == '\n' || choice == '\r');
                  if (choice == 'b') {
                         System.out.println("  Correct!! " );
                   } else if (choice == 'a' || choice == 'c' || choice == 'd') {
                            System.out.println("  Sorry, Wrong Answer\n\n");
                               System.out.println("  Next Question");
                               System.out.println("  Question 3. What is 12 - 4?");
                               System.out.println("     a) 16\n     b) 18\n     c) 8\n     d) 48 ");
                           do {
                                     choice =(char) System.in.read();
                      } while (choice == '\n' || choice == '\r');
                  if (choice == 'c') {
                         System.out.println("  Correct!! " );
                   } else if (choice == 'a' || choice == 'b' || choice == 'd') {
                            System.out.println("  Sorry, Wrong Answer\n\n");
                               System.out.println("  Next Question");
                               System.out.println("  Question 4. What is 12 - 4?");
                               System.out.println("     a) 16\n     b) 18\n     c) 8\n     d) 48 ");
                           do {
                                     choice =(char) System.in.read();
                      } while (choice == '\n' || choice == '\r');
                  if (choice == 'c') {
                         System.out.println("  Correct!! " );
                   } else if (choice == 'b' || choice == 'c' || choice == 'd') {
                            System.out.println("  Sorry, Wrong Answer\n\n");
                               System.out.println("  Next Question");
                               System.out.println("  Question 5. What is 16 / 4?");
                               System.out.println("     a) 4\n     b) 20\n     c) 21\n     d) 12 ");
                           do {
                                     choice =(char) System.in.read();
                      } while (choice == '\n' || choice == '\r');
                  if (choice == 'd') {
                         System.out.println("  Correct!! " );
                   } else if (choice == 'a' || choice == 'b' || choice == 'c') {
                            System.out.println("  Sorry, Wrong Answer\n\n");
                               System.out.println("  Thank You, This concludes your Quiz");
    }

  • How to store the data of a file into an ArrayList?

    Hi! everyone.
    I want to know
    if I have a File, and the data in the file are type int, type String...
    And I have a ArrayList which is of type Question
    How do I store the data of that file into the ArrayList
    I tried to use the while loop(use the hasNextLine() to read the data line by line)
    But I cannot add data which are not of type Question to the ArrayList.
    Can you tell me what I should do, please?
    I also wonder that
    The data of the file are of many types, but when I try to read it with the nextLine(), the data all turn out to be of type String. Why?
    Thank you.
    Edited by: Terry001 on Apr 30, 2008 1:13 PM

    No, a line in the file is just part of a question
    The format of the file is like this:
    *<question type code>                    :     String*
    *<question point value>                    :     int*
    *<question category>                         :     String*
    *<question difficulty level>               :     int*
    *<question text>                              :     String*
    *<question correct answer>               :     String*
    *<optional question-specific data>     :     String*
    *<question terminator>                    :     String*
    And here is an example
    TF //TrueFalseQuestion
    5 //points value
    None //category
    3 //difficulty level
    The capital of the United States is Washington, D.C. //question text
    True // answer
    *** //quetion terminator
    I created an ArrayList in the Test class:
    private ArrayList<Question> questions; // Create inside constructor
        public Test (String name, String instr)
            testName = name;
            scoreEarned = 0;
            scorePossible = 0;
            instructions = instr;
            questions = new ArrayList<Question>(); //[MAX_NUMBER_OF_QUESTIONS];
        }And I tried to use the following method to store the data of the file to the ArrayList
    // This method loads a set of questions from a plain text file
        public void loadQuestionsFromFile(String fileName) throws FileNotFoundException
            try
                File fileReader = new File("input.txt");
                Scanner sc = new Scanner(fileReader);
                while (sc.hasNextLine())
                    // I don't know how to pass the data I got from the nextLine() method to the ArrayList because they are of different type
            catch (FileNotFoundException a)
                System.out.println(a);
        }    As all you said, I should create an Question object in the while loop
    Question temp = new Question ();But I have no idea how to pass the int and String to the Question object.
    Thank you

  • HAI SD EXPERS KINDLY LET ME KNOW

    HERE ARE SOME INT QUESTIONS , KINDLY LET ME KNOW THE ANSWERS
    1.In a sales order, if you want to give rs 10000 more than the credit limit to your customer how do you process this scenario
    2.Mention some latest tickets L1 solved in ur support project
    3.how will u configure batch jobs
    4.what are the fields in purchase requisition
    5.what is RMA process
    6.how you will create nodes in customer hierarchy
    7.suppose you want to offer two different materials as free for one material , how do u process this
    8.you find terms of payment in two pages in customer master data, what is the role of the two
    9.what is the difference b/n item cat group and general item cat group found in material master
    10.what is the link b/n pricing procedure and credit management
    11.what is as is & to be process
    12.tell me about your experiences in support & imp projects
    13. what do u know abt documetation and how u have done that in ur project
    14.diff b/n user exits and enhancements
    15.If the business offer diff rates on the material basing on the quantity, and the break up should appear in the sales order which carries the net value how do u customize this
    THESE ARE VERY MUCH PRACTICAL KINDLY EXTEND UR HELP
    KISHORE
    [email protected]

    1.In a sales order, if you want to give rs 10000 more than the credit limit to your customer how do you process this scenario
    Settings for determining the credit control area of a document.  The settings of items 1 - 4 are taken into account according to their priority.  The credit control area found is stored in field VBAK-KKBER.
    1. Transaction OB38
       Check which credit control area is assigned to the company code.
       Company code:
       Credit control area:
    2. Transaction OVFL
       Check which credit control area is assigned to the sales area.
       Sales area:
       Credit control area:
    3. Transaction XD02 or VD02
       Check which credit control area is assigned to the payer.
       Payer:
       Credit control area:
    4. Transaction SE37
       is user exit EXIT_SAPV45K_001 being used?
    5. Transaction OBZK
       For the settings under items 2 - 4, field "All company codes" must be marked in Transaction
       OB45, or the credit control area must be entered under the relevant company code in table
       T001CM of the credit control areas allowed.
       Company code:
       Credit control areas allowed:
    6. Settings for the credit checks
    7. Transaction OVAK
       which settings do exist for the sales document type used?
       Sales document:
       Check credit:
       Credit group:
    8. Transaction OVAD
       which settings do exist for the delivery type used?
       Delivery type:
       Credit group for delivery:
       Credit group for goods issue:
    9. Transaction OB01
       Credit management/Change risk category
       Definition of the risk category for each credit control area. This risk category can be
       assigned to a credit account by using Transaction FD32.
    10. Transaction OVA8
        Here, the individual credit checks for key field’s
        o credit control area
        o risk category
        o credit group are set. Take these key fields from the above settings and go to the detail
          screen. In particular, check whether fields "Reaction" and "Status/block" are set
          correctly. To carry out follow-up actions in case of a credit block, the credit check
          status must be set (field "Status/block").
    11. Transaction FD32
        Credit master data for the payer of the relevant document.
        Credit account:
        Credit limit:
        Risk category:
        Currency:
    12. Settings for updating the credit values Update of the credit values is required for the limit
        check (static or dynamic credit limit check).
    13. Transaction OVA7
        Update of the credit value is active for the corresponding item type if the check box is marked. This field corresponds to 
        field "Active receivable" in Transaction VOV7.
        Item type: 
        Active receivable:
    14. Transaction V/08, Pricing
        In the pricing procedure used for pricing, subtotal "A" must be entered in a line for
        determining the credit value (mark the pricing procedure and double-click on "Control").
        Usually, the net value plus taxes is used. This way the system is determined to use this
        subtotal for credit pricing. The credit price is stored in field VBAP-CMPRE and used for
        update and credit check.
        You can find the used pricing procedure of the order under "Item -> Condition -> Analysis".
        Pricing procedure:
        Line with subtotal = 'A':
    15. Transaction OB45
        which update group (field "Update") do you use in the relevant credit control area? The
        default setting is "12". If you use another update group, check whether this is fine with
        you. If you open an OSS message, please tell us the alternative update group.
        Credit control area:
        Update:
    16. Transaction OMO1
        which kind of update did you choose for structure S066? 
         In any case, "Synchronous update (1)" has to be chosen as the kind of update. 
         All other settings will lead to errors.
    4.what are the fields in purchase requisition
    http://www.olemiss.edu/projects/sap/Purchasing-_New_Required_Fields_on_PR_and_PO.pdf
    5.what is RMA process
    Return Materials Authorization
    6.how you will create nodes in customer hierarchy
    All the customizing is in SD/Master Data/Bussiness Partner/Customers/Customers hierarchy 
    1) Define hierarchy type: just put and ID and a name to the new hierarchy. 
    2) Set partner determination: if you want to user the hierarchy in price determination, then, in the orders, at the header level, you have to have a Partner Procedure with a partner function for each level. In the partner procedure, in each partner function you must indicate the source partner function. With this informacition, in the order, you obtain the bussiness partner for each partner function. 
    3) Assign acount groups: you indicate which accounts groups are allowed for being part or your hierarchy. 
    4) Assign sales areas: symple you indicate wich sales areas are allowed in your hierarchy. (Here you can customize common sales areas, just for not having to build de hierarchy in all the different sales areas). 
    5) Assigning hierarchy type for pricing: you indicate which classes of documentos uses hierarchy in pricing determination.
    It is possible to maintain so called customer hierarchies. This might be useful when for example you create a condition discount for a customer that is part of such a hierarchy structure. All subnodes in the hierarchy below that customer, will thus receive the same discount. 
    Customer hierarchy setup, firstly decide the hierarchy type to be used. 
    The standard is type A. 
    You can also assign a partner function to the customer so that the higher level customer in the hierarchy is copied into a sales order as a partner function - but you don't need that right?
    Next assign your customer account group to the hierarchy type. And enter the combinations that will be allowed for creating the hierarchy. 
    You want to assign a ship-to to a payer. So enter the ship to account group and enter the payer account group as the higher level. 
    You must also make an entry for permitted sales area assignments. So if you want to a hierarchy for customers in the same sales area then enter the sales area and enter the same one as the higher level sales area. 
    All these settings can be found in the IMG. Under SD - master data - business partners - customers - customer hierarchy 
    7.suppose you want to offer two different materials as free for one material , how do u process this
    Free goods processing - Exclusive method

  • Hi there, need help for this program...thx!

    Hi there guys,
    I have created this applet program that requires a user to login with a user no, and a password. I am using arrays as to store the defined variables,(as required by my project supervisor). My problem here is that when the arrays are declared in class validateUser(), the program would run fine, but i cant login and i get a NullPointerException error. if the arrays are located in actionPerformed, i get a 'cannot resolve symbol' error for the method 'get' and 'if (Admin.equals(admins.get(i).toString())) ' as well as 'if (Password.equals(passwordsget(i).toString())) '. I am not very effecient in java, hence the untidy program (and i have to admit, it isnt any good), so sorry for any inconvenience caused. Once agani thx in advance ;)
    here are my codings :
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.URL;
    import java.net.*;
    import javax.swing.*;
    import java.lang.*;
    import java.util.Vector;
    public class eg31662 extends Applet implements ActionListener
         Panel panel1, panel2, panel3, panel4, panel5;
         Button login, enter;
         Label inst, top, admin, pass, fieldlabel;
    TextField adminF, passF, field;
    String Admin, Password;
    Vector admins, passwords;
         Thread thread = null;
         boolean status = false;
              public class validateUser extends Applet
                   String[] admins = {"User1", "User2", "User3"};
                   String[] passwords = {"P1", "P2", "P2"};
         public void init()
              setLayout (new BorderLayout());
              panel1 = new Panel(new FlowLayout());
              panel2 = new Panel(new FlowLayout());
              //login button
              login = new Button("Login");
              //instruction
              inst = new Label("Please type in your User no. and the given password in order to proceed");
              //label
              top = new Label("Login login");
              admin = new Label("Admin No :");
              pass = new Label("Password :");
              //input textfields
              adminF = new TextField(8);
              passF = new TextField(10);
              passF.setEchoChar('*');
              panel1.setBackground(Color.gray);
              panel2.setBackground(Color.orange);
              panel2.add(admin);
              panel2.add(adminF);
              panel2.add(pass);
              panel2.add(passF);
              panel2.add(login);
              panel2.add(inst);
              panel1.add(top);
              add(panel1, BorderLayout.NORTH);
              add(panel2, BorderLayout.CENTER);
              login.addActionListener(this);
              setSize(500,400);
         void mainpage()
              boolean flag = true;
              setLayout (new BorderLayout());
              panel1 = new Panel(new FlowLayout());
              panel2 = new Panel(new FlowLayout());
              top = new Label("Welcome");
              enter = new Button("Enter");
              panel2.setBackground(Color.orange);
              panel1.setBackground(Color.gray);
              fieldlabel = new Label("Type something here :");
              field = new TextField(20);
              add(panel1, BorderLayout.NORTH);
              add(panel2, BorderLayout.CENTER);
              panel2.add(fieldlabel);
              panel2.add(field);
              enter.addActionListener(this);
         public void start() {
              if(thread == null) {
                   status = true;
         public void stop() {
              status = false;
         public void run() {
              while(status == true) {
                   try {
                        thread.sleep(50);
                   catch(InterruptedException ie) {
                   repaint();
              thread = null;
         public void actionPerformed(ActionEvent ev)
                   //String[] admins = {"User1", "User2", "User3"};
                   //String[] passwords = {"P1", "P2", "P3"};
              if(ev.getSource() == login)
                   Admin = adminF.getText();
                   Password = passF.getText();
              boolean ok = true;
              for (int i = 0; i < admins.size(); i++) {
              if (Admin.equals(admins.get(i).toString())) {
              if (Password.equals(passwords.get(i).toString())) {
              ok = true;
              this.setVisible(false);
              //break;
                             JOptionPane.showMessageDialog(null, "Welcome, u have successfully logged in");
                             mainpage();
              else {
              ok = false;
              else {
              ok = false;
              if (ok == false) {
                             JOptionPane.showMessageDialog(null,
                        "Incorrect Password or Admin No, Please Try Again",
                        "Access Denied",
                        JOptionPane.ERROR_MESSAGE);
              else {
              this.setVisible(false);
    }

    Hi, sorry to bring this thread up again, but this is actually a continuation from my previous posted program. Hope u guys can help me again!
    Right now i'm supposed to come up with a simple quiz program, which consists of the center panel displayin the question (in a pic format), and a textfield to enter the answer at the lower panel. this goes on for a couple of pages and once it is completed, the final page would display the total correct answers out of the number of questions, as well as the score in percentage form.
    The few(or many) problems taht i'm facing are :
    1)How do i save the answers that are typed in each textfieldAnd later on checked for the correct answer based on the array given?
    2)How do i go about doing the final score in percentage form and total of correct answers?
    3)I previously tried out using canvas, but it didnt seem to work. my questions(pictures) that are supposed to displayed in the center(canvas) produce nothing. How do i rectify that?
    i'm really sorry for the mess in the codings, hope this wouldnt be a hassle for any of u out there. Once again thanks in advance!
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.URL;
    import java.net.*;
    import java.util.Vector;
    import javax.swing.*;
    import java.awt.image.*;
    import java.lang.*;
    import java.awt.Graphics;
    public class eg31662 extends Applet implements ActionListener
        Panel panel1, panel2, panel3, panel4, panel5;
        Button login, enter;
        Label inst, top, admin, pass, startLabel;
        TextField adminF, passF, field;
        String Admin, Password;
        Vector admins, passwords;
         //Quiz declarations
         TextField ansF1,ansF2,ansF3;
         Button startBut, next0, next1, finishB, previous1;
         Image q1, q2, q3;
         Image ques[] = new Image[2];
         boolean text = false;
         boolean checked = false;
         int correct = 0;
         String [] answer = new String [2];
         String [] solution = {"11", "22", "33"};
         boolean text = false;
         boolean sound = true;
         int red,green,blue;
         int question =0;
         int good = 0;
         boolean pause= false;
         boolean start = true;*/
        Thread thread = null;
        boolean status = false;
        public void init()
            validateUser();
            setLayout (new BorderLayout());
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            //login button
            login = new Button("Login");
            //instruction
            inst = new Label("Please type in your UserName and the given " +
                             "password in order to proceed");
            //label
            top = new Label("Top Label");
            admin = new Label("User Name :");
            pass = new Label("Password :");
            //input textfields
            adminF = new TextField(8);
            passF = new TextField(10);
            passF.setEchoChar('*');
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
              panel3.setBackground(Color.gray);
            panel2.add(admin);
            panel2.add(adminF);
            panel2.add(pass);
            panel2.add(passF);
            panel2.add(login);
            panel3.add(inst);
            panel1.add(top);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
            login.addActionListener(this);
            setSize(500,400);
        private void validateUser()
            String[] adminData    = {"t", "User1", "User2", "User3"};
            String[] passwordData = {"t", "P1", "P2", "P3"};
            admins = new Vector();
            passwords = new Vector();
            for(int j = 0; j < adminData.length; j++)
                admins.add(adminData[j]);
                passwords.add(passwordData[j]);
        private void Mainpage()
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
              panel3 = new Panel(new FlowLayout());
            top = new Label("Welcome");
            enter = new Button("Enter");
            panel2.setBackground(Color.orange);
            panel1.setBackground(Color.gray);
            panel3.setBackground(Color.gray);
            startLabel = new Label("Welcome! " +
                                          "Please click on the 'Start' button to begin the quiz ");
              startBut = new Button("Start");
              startBut.requestFocus();
              Dimension dim = getSize();
              startBut.setSize(50,20);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
            panel2.add(startLabel);
            panel2.add(startBut);
            startBut.addActionListener(this);
            validate();
            repaint();
        private void Quiz1()
              //quizCanvas = new Canvas();
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
            panel3.setBackground(Color.gray);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
              q1 = getImage(getDocumentBase(), "1.gif");
              ques[0] = q1;
              //ques[1] = q2;
              //previous = new Button("<");
              next0 = new Button("Done");
            ansF1 = new TextField(25);
              next0.addActionListener(this);
              //quizCanvas.insert(ques1);
            //panel3.add(previous);
            panel3.add(next0);
            panel3.add(ansF1);
            //panel2.add("1.gif");
              ansF1.requestFocus();
              ansF1.setText("focussing");
            validate();
            repaint();
         public void Quiz2(){
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
            panel3.setBackground(Color.gray);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
              q2 = getImage(getDocumentBase(), "2.gif");
              ques[1] = q2;
              next1 = new Button("Done");
            ansF2 = new TextField(25);
              next1.addActionListener(this);
            panel3.add(next1);
            panel3.add(ansF2);
              ansF2.requestFocus();
              ansF2.setText("focussing");
            validate();
            repaint();
         public void Quiz3(){
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
            panel3.setBackground(Color.gray);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
              q3 = getImage(getDocumentBase(), "3.gif");
              ques[2] = q3;
              finishB = new Button("Finish");
            ansF3 = new TextField(25);
              finishB.addActionListener(this);
            panel3.add(finishB);
            panel3.add(ansF3);
              ansF3.requestFocus();
              ansF3.setText("focussing");
            validate();
            repaint();
        public void start() {
            if(thread == null) {
                status = true;
        public void stop() {
            status = false;
        public void actionPerformed(ActionEvent ev)
            boolean ok = true;
            if(ev.getSource() == login)
                Admin = adminF.getText();
                Password = passF.getText();
                for (int i = 0; i < admins.size(); i++) {
                    if (Admin.equals(admins.get(i).toString())) {
                        if (Password.equals(passwords.get(i).toString())) {
                            ok = true;
                            JOptionPane.showMessageDialog(null,
                                        "Welcome, u have successfully logged in");
                            Mainpage();
                            break;
                        else {
                            ok = false;
                    else {
                        ok = false;
                if (!ok) {
                    JOptionPane.showMessageDialog(null,
                                  "Incorrect Password or Admin No, Please Try Again",
                                  "Access Denied",
                                   JOptionPane.ERROR_MESSAGE);
            if(ev.getSource() == startBut)
                   Quiz1();
              if (ev.getSource () == next0) {
                   saveanswer();
                   Quiz2();
              if (ev.getSource () == next1) {
                   //saveanswer();
                   Quiz3();
              if (ev.getSource () == finishB) {
                   //saveanswer();
                   //checkanswer();
         /*class quizCanvas extends Canvas {
              private Image quest;
              public quizCanvas() {
                   this.quest = null;
              public quizCanvas(Image quest) {
                   this.quest = quest;
              public void insert(Image quest) {
                   this.quest=quest;
                   repaint();
              public void paint(Graphics g) {
         public void checkanswer() {
              if (!checked) {
              /*question = 0;
                   for (int a=1;a<16;a++) {
                        question++;*/
                        if (ansF1) {
                             if (answer[1].toUpperCase().equals(solution[1])) {
                                  correct++;
                        if (ansF2) {
                             if (answer[2].toUpperCase().equals(solution[2])) {
                                  correct++;
                        if (ansF3) {
                             if (answer[3].toUpperCase().equals(solution[3])) {
                                  correct++;
              checked = true;     }
         public void saveanswer() {
              if (text) {
                   if (!ansF1.getText().equals("")) {
                        answer [Quiz1] = ansF1.getText();
                   //answer2[question] = tf2.getText();
                   if (!ansF2.getText().equals("")) {
                        answer [] = ansF2.getText();
                   if (!ansF3.getText().equals("")) {
                        answer [] = ansF3.getText();
    }

  • Scanning... and Mulitple String lines

    My text file that I want to scan looks like this format:
    Name of Student
    Test Answers (True or false)
    Example:
    Joe Smith
    TFTFTFFTFFFTFFTFFTFTTFF etc..
    Jane Sims
    FTFTFTTFFTTFFTFFFTFTFTF etc..
    The issue is - I know how to scan the data of my textfile. However I am dealing with Strings on two lines.
    I want to compute the True and False answers, by tallying them up.
    But my real question is this.
    How can I seperate the detection of the line with the name, and the line with the True & false answers.
    import java.util.*;
    import java.io.*;
    public class TureFalseTest {
         public static void main(String[]args) throws FileNotFoundException {
         System.out.println("This program computes the results of students from the test");
         Scanner input = new Scanner(new File("answers.txt"));
         while(input.hasNextLine()){
              String questionResults = input.nextLine();
              // this is the part that is getting me troubled. 
         public static int[] computeAnswers (String questionResults) {
              int[] questions = new int[70]
                    // going to continue on with my arrays and what not.Below is what I got, I know that input.nextLine(); will start scanning each line in the text document, line-by-line.
    I want to run my array/caclulations only on the True & False answers of every student.
    But i'm not understanding
    If someone could give me some pointers or tips, that will be greatly appreciated.

    accident 2nd post.
    Edited by: theendgame on Nov 18, 2008 6:29 PM

  • Applets on a tripod page

    I'm trying to get a really simple Applet to work on my lycos / tripod homepage. It doesn't seem to work. I haven't published any Applets before, so I might be missing something obvious. Can someone give me some pointers.
    Info:
    Its a single class JApplet thing.
    Doesn't do anything complicated.
    I get a security exception when I run from the tripod site although it runs fine on my own machine.
    This is the top line exception I get
    java.security.AccessControlException: access denied (java.net.SocketPermission members.lycos.co.uk resolve)
    Tripod won't help me :(
    So can you .....
    Cheers,
    Dave.

    Here is the code, just asks you some questions and gives you diff answers depending on score. Pretty simple I'd say.
    import java.awt.*;
    import java.applet.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.color.*;
    public class Hosometer extends JApplet {
         int total;
         int question;
         JTextArea q;
         JButton one;
         JButton two;
         JButton three;
         JButton four;
         JButton five;
         String [] questions = { "Q1",
                                 "Q2",
                                 "Q3",
                                 "Q4",
                                 "Q5",
                                 "Q6",
                                 "Q7"};
         public void init() {
      setBackground(new Color(5866895));
      total = 0;
         q = new JTextArea(7,30);
         q.setEditable(false);
         q.setBackground(new Color(5866895));
      one = new JButton("1 (bad)");
      one.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
          next(1);
      two = new JButton("2");
      two.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
          next(2);
      three = new JButton("3(moderate)");
      three.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
          next(3);
      four = new JButton("4");
      four.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
          next(4);
      five = new JButton("5 (good)");
      five.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
          next(5);
      JPanel bt = new JPanel();
      JPanel main = new JPanel();
      bt.setBackground(new Color(5866895));
      main.setBackground(new Color(5866895));
      bt.add(one);
      bt.add(two);
      bt.add(three);
      bt.add(four);
      bt.add(five);
         q.setText(questions[0]);
         main.add(q);
         main.add(bt);
         getContentPane().add(main);
         public void next(int score)
            total = total + score;
            question ++;
            if(question<questions.length)
              q.setText(questions[question]);
            else{
              one.setEnabled(false);
              two.setEnabled(false);
              three.setEnabled(false);
              four.setEnabled(false);
              five.setEnabled(false);
              int pct = (total * 100) / (35);
              if(total < 8)
                q.setText("");
              else if (total < 16)
                q.setText("");
              else if (total < 22)
                q.setText("");
           else if (total < 28)
             q.setText("");
           else if (total < 32)
              q.setText("");
           else if (total < 35)
              q.setText("");
           else if (total == 35)
              q.setText("Answer1");

  • Can been JOptionPane.showMessage used in applet?

    I am a newer in java programming. i have written a java applet programm. But when i run it, there is something wrong. Can someone tell me where is the problem. Here is the programm.
    import javax.swing.*;
    import java.awt.*;
    import java.applet.*;
    public class ChenTest extends JApplet{
    String input;
         int output;
    int x=0;
         int y=0;//����init��
    public void init(){
    public void paint(Graphics g){
    output = question();
         input =JOptionPane.showInputDialog("enter the result ");
    System.out.println("init"+y);
    x = Integer.parseInt(input);
         while(x !=output){
         g.drawString("no",25,25);
              input =JOptionPane.showInputDialog("try again ");
              x = Integer.parseInt(input);
              System.out.println(x);
         g.drawString("yes",50,50);
         y++;
    public int question()
         int number1,number2,result;
    number1 = 1+(int)(Math.random()*9);
    number2 =1+(int)(Math.random()*9);
    // System.out.println("how "+number1 +"*"+number2);
         System.out.println("chen"+number1+"*"+number2);
         JOptionPane.showMessageDialog(null,"how much is "+number1 +"* "+number2);
    return result = number1 * number2;
    }

    "there is something wrong" does not compute ...
    hint: if you use swing in your applet, you need to have at least Java2 plugin running with your browser.

  • Question about size of ints in Xcode

    Hello. I have a a few quick questions about declaring and defining variables and about their size and so forth. The book I'm reading at the moment, "Learn C on the Mac", says the following in reference to the difference between declaring and defining a variable:
    A variable declaration is any statement that specifies a variables name and type. The line *int myInt;* certainly does that. A variable definition is a declaration that causes memory to be allocated for the variable. Since the previous statement does cause memory to be allocated for myInt, it does qualify as a definition.
    I always thought a definition of a variable was a statement that assigned a value to a variable. If a basic declaration like "int myInt;" does allocate memory for the variable and therefore is a definition, can anyone give me an example of a declaration that does not allocate memory for the variable and therefore is not a definition?
    The book goes on, a page or so late, to say this:
    Since myInt was declared to be of type int, and since Xcode is currently set to use 4-byte ints, 4 bytes of memory were reserved for myInt. Since we haven't placed a value in those 4 bytes yet, they could contain any value at all. Some compilers place a value of 0 in a newly allocated variable, but others do not. The key is not to depend on a variable being preset to some specific value. If you want a variable to contain a specific value, assign the value to the variable yourself.
    First, I know that an int can be different sizes (either 4 bytes or 8 bytes, I think), but what does this depend on? I thought it depended on the compiler, but the above quote makes it sound like it depends on the IDE, Xcode. Which is it?
    Second, it said that Xcode is currently set to use 4-byte ints. Does this mean that there is a setting that the user can change to make ints a different size (like 8 bytes), or does it mean that the creators of Xcode currently have it set to use 4-byte ints?
    Third, for the part about some compilers giving a newly allocated variable a value of 0, does this apply to Xcode or any of its compilers? I assume not, but I wanted to check.
    Thanks for all the help, and have a great weekend!

    Tron55555 wrote:
    I always thought a definition of a variable was a statement that assigned a value to a variable. If a basic declaration like "int myInt;" does allocate memory for the variable and therefore is a definition, can anyone give me an example of a declaration that does not allocate memory for the variable and therefore is not a definition?
    I always like to think of a "declaration" to be something that makes no changes to the actual code, but just provides visibility so that compilation and/or linking will succeed. The "definition" allocates space.
    You can declare a function to establish it in the namespace for the compiler to find but the linker needs an actual definition somewhere to link against. With a variable, you could also declare a variable as "extern int myvar;". The actual definition "int myvar;" would be somewhere else.
    According to that book, both "extern int myvar;" and "int myvar;" are declarations, but only the latter is a definition. That is a valid way to look at it. Both statements 'delcare' something to the compiler, but on the second one 'define's some actual data.
    First, I know that an int can be different sizes (either 4 bytes or 8 bytes, I think), but what does this depend on? I thought it depended on the compiler, but the above quote makes it sound like it depends on the IDE, Xcode. Which is it?
    An "int" is supposed to be a processor's "native" size and the most efficient data type to use. A compiler may or may not be able to change that, depending on the target and the compiler. If a compiler supports that option and Xcode supports that compiler and that option, then Xcode can control it, via the compiler.
    Second, it said that Xcode is currently set to use 4-byte ints. Does this mean that there is a setting that the user can change to make ints a different size (like 8 bytes), or does it mean that the creators of Xcode currently have it set to use 4-byte ints?
    I think that "setting" is just not specifying any option to explicitly set the size. You can use "-m32" or "-m64" to control this, but I wouldn't recommend it. Let Xcode handle those low-level details.
    Third, for the part about some compilers giving a newly allocated variable a value of 0, does this apply to Xcode or any of its compilers? I assume not, but I wanted to check.
    I don't know for sure. Why would you ask? Are you thinking of including 45 lines of macro declarations 3 levels deep to initialize values based on whether or not a particular compiler/target supports automatic initialization? Xcode current supports GCC 3.3, GCC 4.0, GCC 4.2, LLVM GCC, CLang, and Intel's compiler for building PPC, i386, and x86_64 code in both debug and release, with a large number of optimization options. It doesn't matter what compiler you use or what it's behavior is - initialize your variables in C.

  • Question in: charAt( int  i ) , method's of StringBuffer

    In class String Buffer() there is a method called charAt( int i ). My question are:
    a) What is the exact integer range for data type int?
    b) Consider the code below:
    =================================================================================
    buf_out     = new BufferedOutputStream(servlet_out); // servlet_out is an instant of ServletOutputStream
    int str_len     = str_buf.length(); // str_buf is an instant of StringBuffer
    for (int i = 0; i < str_len; i++) {
         buf_out.write(str_buf.charAt(i));
    =================================================================================
    Now,what are the consequences if the value of str_len is bigger than the integer range?
    Hope to c positive response from u guys. Thanks

    a) 2^31 - 1 (just shy of 2 GB) -- see Integer.MAX_VALUE
    b) All the size related methods of StringBuffer take an int as an argument. It therefore follows that a StringBuffer may not be larger than Integer.MAX_VALUE characters. Also, since StringBuffer is backed by a char[] array, it also cannot be larger than Integer.MAX_VALUE since arrays may only have at most Integer.MAX_VALUE elements.
    The whole argument is pretty much academic however -- since a StringBuffer with 2 billion elements will take up a minimum of 4 GB of RAM (chars are 32 bits), its highly unlikely that you could every create a StringBuffer that large without blowing up your JVM.

Maybe you are looking for

  • How can i see if my gift card has been redeemed without redeeming it to my account?

    i have a old gift card that i want to give as a gift to someone else, i see the only way to see if it has been used is to "redeem" it by entering the code and redeeming it into your account, but since i want to give it to someone else i cant redeem i

  • How do I turn turn off the right pane in Adobe Reader XI?

    I have been using Adobe Reader since 2007, and recently I have been unable to turn off the right pane while reading. If anyone knows how I can deal with this problem, I would really appreciate it. Thanks Don Randall

  • Photoshop cs4 patch

    I have photoshop cs4 extend for vista 64. When I update photoshop every thing was good. Then I open photoshop cs4, not only did the update made my photoshop cs4 extend to photoshop cs4 it is also telling me there is something wrong with my graphic ca

  • PCD Eventing

    Hi, Is it possible for the PCD low level API's of create / modify / delete to send out events, that can be subscribed to, for instance using a portal service? Alternatively is it possible to listen to any change in the PCD? I need to run a few report

  • ITunes 9.2 (Error Message -50)

    I seldom have the need to access iTunes Store (not iPhone, iTouch, iPad user) - However recently I discovered that my iTunes 9.2 is unable to access the online store at all! This will definitely affect me in the near future if I decides to get the ne