Wednesday, March 2, 2011

Do Women Prefer Shaved Mens Genitals

Test your knowledge (POS1: 2A, 2C)

you will find here a number of questions and tasks that you should be around the middle of the second year computer science can answer or solve.

theory
  1. What is a dictionary in Python?
  2. What does the term "sequence" in Python? Give some examples.
  3. As defined a function in Python?
  4. What types of parameter passing it in Python?
  5. How can a Python function more as a value (parameter) or return?
  6. Give an example of a shortest possible function in Python to! What
  7. is a variable?
  8. What is "Duck Typing"?
  9. How are formed in Python for loops?
  10. What is a Python module? What modules are used?
  11. How can a (text) file be read?
  12. How to evaluate in Python command line parameters?
  13. What basic data types, you know? Also enter the memory requirements and the values range.
  14. What are the properties of an object? As is reflected back into the class?
  15. What control structures, you know?
  16. What is an array?
  17. Give an example of a one dimensional array in Java.
  18. How to initialize a one-dimensional array in Java?
  19. Give an example of a two dimensional array in Java.
  20. How to initialize a two-dimensional array in Java?
  21. Can we define a two-dimensional array in Java, which "is not rectangular (ie square: all the lines of equal length) is?
  22. enter an algorithm (without program details) in order to identify all elements of a one-dimensional arrays that meet a certain criteria (for example, is larger than a certain value).
  23. enter an algorithm (without program details) in order to identify all elements of a two-dimensional array, a particular Criterion is met.
  24. enter an algorithm (without program details) in order to determine the maximum of all values of a one-dimensional arrays.
  25. enter an algorithm (without program details) in order to determine the minimum of all values of a one-dimensional arrays.
  26. enter an algorithm (without program details) in order to determine the maximum of all values of a two-dimensional arrays.
  27. enter an algorithm (without program details) in order to determine the minimum of all values of a two-dimensional arrays.
  28. What is a function? Give an example in Java, including the use of the function.
  29. What is a method? Give an example in Java, including the use of the function.
  30. What is the difference between a variable of a basic data type and a variable of type class?
  31. What is a class?
  32. What is an object? Explain the relationship between object and class.
  33. What are Strings?
  34. How to compare strings?
  35. Why do you need comments?
  36. Why do you need coding standards?
  37. compare Java with Python.
  38. What should you remember the story "Shlemiel the Painter"?
  39. What must be done in principle (without program details), to read from a file? What
  40. must always be made (without program details), to write to a file?
  41. enter an algorithm (without program details) in order to identify all lines of a text file that a particular criterion (for example, contains a certain string) meet. What types of errors
  42. program (ier) do you know? How to find this error?
  43. How many have main () methods must a Java class? How many can
  44. main () methods a Java class can have?
  45. How many classes in a single Java file be implemented?
  46. What value does the variable anInteger ? Justify your answer!
      int   anInteger   =     Integer  .   MAX_VALUE   +     a  ;   
  47. What is implicit or explicit cast? Name at least one example.
practice: there
In this blog and also in the old blog It already has a number of tasks. Compare your answers with those of your classmates.
Here are a few "basic exercises "
  1. Create a Python program, which determines the maximum of a sequence. Do this, define a fixed test sequence with the following values [- a , - 23 , - 2 , - 32 , - 89 , - 100 , - a , - 99 ] . Find additional sample test data.
  2. you create a Python program, which determines the minimum of a sequence. Do this, define a fixed test sequence with the following values [ a , 23 , 2 , 32 , 89 , 100 , a , 99 ] . Find additional sample test data.
  3. you create a Java program, which determines the maximum of a sequence. Do this, define a fixed test sequence with the following values [- a , - 23 , - 2 , - 32 , - 89 , - 100 , - a , - 99 ] . Find additional sample test data.
  4. you create a Java program that calculates the minimum of a sequence. Do this, define a fixed test sequence with the following values [ a , 23 , 2 , 32 , 89 , 100 , a , 99 ] . Find additional sample test data.
  5. you create a Python program that determines the frequency of elements of a sequence (list). Do this, define a test sequence with the following values [ a , 2 , - 3 ,   4 ,   2 ,   1 ,   10 ,   - 3 ,   4 ,   2 ,   2 ,   10 ]  bzw.  [ "hello" , "du" , "test" , "du" , "mouse" , "test" , "Test" ] . The result should be a list of different values, and how often they occur.
  6. Consider the method divide in the following program. translates into the program? If not corrected, then the error:
      public     class     DivisionApp     {  
    public static void main ( String [] args ) {
    int result = divide ( 40 , 5);
    system. out . println ( "Result:" + result);}


    public static int divide ( int divident , int divisor ) {
    if ( divisor > 0 ) {
    ;
    return divident / divisor ;
    }
    }
    }
  7. following output should be created: one 3 5 7 9 . Solve the problem
    • a while loop
    • using a Thurs using - while loop
    • a for loop and using the modulo Operators using a
    • for loop without the modulo operator
  8. following output should be created: one 2 4 7 11 16 22 29 37 . Solve the problem
    • a Thurs using - while loop
    • using a for Loop
  9. Write outputs a Java program that use a stack following values in reverse order: 23 21 20 18 17 13 11 5 3
  10. Write a Java program that use a queue following values in the same order prints: 23 21 20 18 17 13 11 5 3
  11. writing, you can use based on the last two examples of programs that are strings instead of integers.

0 comments:

Post a Comment