Preview

Java Tutorial Questions

Good Essays
Open Document
Open Document
3113 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Java Tutorial Questions
Tutorial 1 - Calculation 1. What are the values of the following expression? (a) 6 / 3 * 7 (b) 7 * 6 / 3 (c) 28 / 5 (d) 16 % 2 (e) 28 % 5 (f) 28 % 3 * 5 + 1 (g) 20 / (4 + 1) (h) 18 / 2 + 14 / 2 2. What is the value of each of the following boolean expression? (a) 4 >1 (b) 5 <= 15 (c) 43 <= 43 (d) 2 = = 3 (e) 2 + 5 = = 7 (f) 3 + 8 < = 10 (g) 3 != 9 (h) 13 ! = 13 (i) -4 ! = 4 (j) 2 + 5 * 3 = = 21 3. Are the following identifiers valid? (a) applet (b) Applet (c) a++ (d) --a (e) 4#R (f) #44 (g) apps 4. Declare the following (a) an int variable with an initial value of 0 (b) a long variable with an initial value of 10000 (c) a float variable with an initial value of 3.4 (d) a double variable with an initial value of 34.45 (e) a char variable with an initial value of 4 (f) a boolean variable with an initial value of true 5. Find the largest and smallest byte, short, int, long, float, and double. 6. Are the conversions shown below valid or invalid? If valid, what is the result. (a) char c = 'A'; int i = (int) c; (b) boolean b = true; int i = (int) b; (c) float f = 1000.34f; int i = (int) f; (d) double d = 1000.34; int i = (double) d; (e) int i = 1000; char c = (char) i; (f) int i = 1000; boolean b = (boolean) b; 7. Write a statement or comment to accomplish each of the following: (a) state that this program will calculate the product of 3 integers. (b) name the class name as Calculate (c) declare the variable x, y and z to be of type int. (d) initialize the variable x and y to be 3, and 4. (e) assign the result of addition of x and y to variable z. (f) print out the result as x + y = z. 8. Assume the

You May Also Find These Documents Helpful

  • Satisfactory Essays

    RATIONALE: The following calculations show that answer e is correct. The others are all wrong.…

    • 5414 Words
    • 22 Pages
    Satisfactory Essays
  • Satisfactory Essays

    2. Read pages 146 and 147 in the textbook and then express your answer using international standard time.…

    • 741 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Advance Managerial Finance

    • 3165 Words
    • 13 Pages

    What is the bond 's conversion ratio? What is the bond 's conversion value? What is the bond 's straight-debt value?…

    • 3165 Words
    • 13 Pages
    Good Essays
  • Better Essays

    Jdt2 Task 1

    • 1786 Words
    • 8 Pages

    | Per your request to investigate and recommend Toy Company’s position regarding Claim #1-2013; this report was generated. The initial research has been finalized and recommendations determined. I will refer to the claim by its number #1-2013 and the claimant as AA23 to keep the confidentiality of the claimant. First this report will provide a summary of the claim and the history associated with it. Second it will discuss the definition of Constructive Discharge and its relevance to this claim. Third it will provide the specific areas under the Title VII of the Civil Rights Act of 1964. Fourth it will offer recommendations and supporting legal references. Fifth it will recommend proactive steps to avoid future legal issues in relationship to the Title VII of the Civil Rights Act of 1964. And finally any references used in this research will be provided. A. Definition of Constructive DischargeSummary of Claim and history:In January 1, 2013 a new policy was implemented to support exponential company growth. This policy impacted all production employees. The impacted employees were notified of the changes two months in advance of the January 2013 implementation to allow for assimilation and training on the new shifts schedules and there impacts. Production employee schedules were shifted from a Monday through Friday schedule, 8 hour shift to a Monday through Sunday schedule, 12 hour shift, four working days can occur any day of the week. This schedule requires all production employees to work on holy days regardless of religious affiliation as the production now runs seven days a week.Office staff members were not impacted by this policy change.AA23 quit on January 2, 2013 after new policy was in effect.…

    • 1786 Words
    • 8 Pages
    Better Essays
  • Good Essays

    Math Task 5

    • 413 Words
    • 2 Pages

    In order to determine when the two options would be equivalent, we will use the substitution method.…

    • 413 Words
    • 2 Pages
    Good Essays
  • Better Essays

    Jdt2 Task 1

    • 898 Words
    • 4 Pages

    MEMO TO: FROM: DATE: SUBJECT: Mrs. Jane Smith, CEO, Jinkie Pops Toy Co. Amy Hance, Elementary Division Manager August 22, 2012 Constructive Discharge Claim of Mr. William Fleck…

    • 898 Words
    • 4 Pages
    Better Essays
  • Satisfactory Essays

    Number Conversions

    • 180 Words
    • 2 Pages

    2. Convert your hexadecimal result back into decimal to prove your answer is correct. This is…

    • 180 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    VIII. Converting from Factored Form to Standard Form – Convert the following functions into Standard Form…

    • 269 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    JDT2 Task 1

    • 1672 Words
    • 6 Pages

    Title VII of the Civil Rights Act of 1964 protects employees from workplace discrimination on the basis of race, color, religion, sex and national origin. When an employer engages in practices that create a hostile work environment for any of these protected groups, making conditions so intolerable that an employee feels compelled to resign, it is known as constructive discharge Former employee Andy Anderson now alleges that our company engaged in religious discrimination when our production schedule changes went into effect at the first of the year. The changes required all production employees to occasionally work on a religious holy day, and Mr. Anderson has submitted a constructive discharge claim with the U.S. Equal Employment Opportunity Commission (EEOC).…

    • 1672 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    Quiz Comp Archi

    • 438 Words
    • 3 Pages

    4) Please describe how the clock works in the digital circuit and what are main concerns on the clock design (performance, power).…

    • 438 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Java Chapter 2 Quiz

    • 2047 Words
    • 9 Pages

    4. The ____ is normally considered the standard output and standard input devices, and usually refer to…

    • 2047 Words
    • 9 Pages
    Powerful Essays
  • Powerful Essays

    5. What two things must you normally specify in a variable declaration? You must specify the variable type and identifier.…

    • 748 Words
    • 3 Pages
    Powerful Essays
  • Better Essays

    JDT2-Task 1

    • 1828 Words
    • 8 Pages

    The following are my findings regarding the constructive discharge from the employee that has left our company after our policy change.…

    • 1828 Words
    • 8 Pages
    Better Essays
  • Good Essays

    Reading Guide Questions

    • 487 Words
    • 2 Pages

    What information about Thomas Putnam does Arthur Miller tell us in his expository aside? What does Ann Putnam claim in the play about her dead babies?…

    • 487 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Reveiwing the Basics

    • 626 Words
    • 3 Pages

    Which is the least expensive edition of Vista that can use the Aero user interface?…

    • 626 Words
    • 3 Pages
    Good Essays