SJSU/Udacity CS046

Problem Set 3

  1. Numbers
  2. Volume of a Cone
  3. Last Digit
  4. Average
  5. String Length
  6. Concatenation
  7. Strings
  8. If Statements
  9. First Character
  10. Last Character
  11. Yard Calculator
  12. Mileage Printer
  13. Balloon

Numbers

  int counter = 7;
  counter++;
  System.out.println(counter);
Write the code to declare a constant MINUTES_PER_SECOND in a method. Initialize it to 60. final int MINUTES_PER_SECOND = 60;
Write the code to declare a constant MINUTES_PER_SECOND out side any method. (That is, it can be used by any method in the class - or in a different class) Initialize it to 60. public static final int MINUTES_PER_SECOND = 60;
A process takes 2345.9 hours. Write a Java expression to determine the number of whole days needed. There will be a fractional part to the number of days, but we want only the number of whole days. (int)(2345.9 / 24)
Given that x = 5 and y = 8, what is the value of this expression?
x + y / 2
9
What is printed by this code segment? 3
What is 7 % 2 1

Problem on this page?

Your name:

Your email address:

Problem description:

To protect against spam robots, please answer this simple math problem:
× =