SweetStudy (HomeworkMarket.com)
  • homework question
    chat0
Home.Literature.
Help.
  • Contact Us
  • FAQ
Log in / Sign up
  • Log in / Sign up
  • Post a question
  • Home.
  • Literature.
  • Help.
  • Contact Us
  • FAQ
  • Java4

    profileGhamdikar
    a4.docx
    Home>Information Systems homework help>Java4

    [Type here]

    Course Title: Business Computer Languages

    Course Code : IT 401

    Assignment 4

    Note :

    · Due date: 01 /05 /2016

    · 15 Marks Value 15/3 =5 Marks

    · Copied assignment will be graded zero mark.

    · Assignment submitted after due date will not be accepted; it will be considered to be late and will have zero mark.

    Q1. Write the syntax for

    · declaring an array holding 10 String values

    · declaring an ArrayList holding String values. [1 Points]

    Q2. Use a for loop to fill an Arraylist with the square of the numbers 1 to 10. The output should be ( 1, 4, 9, 16, ..100): [3 Points]

    Q3. Rewrite the following loops, using the "for each" construct. Here data is an array of double values. [1 point]

    for (int i = 0; i < data.length; i++)
            sum = sum + data[i];

    Q4. Write preconditions for the following methods. Do not implement the methods. [3 point]

    a. public static double sqrt(double x) 

    b. public static String romanNumeral(int n) 

    c. public static String weekday(int day) 

    Q4. Define class cohesion and class coupling. [1 Points]

    Q5. What is a static method ? What is a static variable ? Explain and provide examples. [2 Points]

    Q6. What is an Immutable Class ? [1 Point]

    Q7. Draw a memory diagram that shows why the following method can't swap two BankAccount objects. [3 point]

    public static void falseSwap(BankAccount a, BankAccount b)

    {

    BankAccount temp = a;

    a = b;

    b = temp;

    }

    1. Applied Sciences
    2. Architecture and Design
    3. Biology
    4. Business & Finance
    5. Chemistry
    6. Computer Science
    7. Geography
    8. Geology
    9. Education
    10. Engineering
    11. English
    12. Environmental science
    13. Spanish
    14. Government
    15. History
    16. Human Resource Management
    17. Information Systems
    18. Law
    19. Literature
    20. Mathematics
    21. Nursing
    22. Physics
    23. Political Science
    24. Psychology
    25. Reading
    26. Science
    27. Social Science
    28. Liberty University
    29. New Hampshire University
    30. Strayer University
    31. University Of Phoenix
    32. Walden University
    • Home
    • Homework Answers
    • Archive
    • Tags
    • Reviews
    • Contact
      • twitter
      • facebook
    Copyright © 2026 SweetStudy.com (Step To Horizon LTD)