expressions- de paul university(expressions- de paul university).docVIP

  • 18
  • 0
  • 约7.11千字
  • 约 6页
  • 2017-01-19 发布于湖南
  • 举报

expressions- de paul university(expressions- de paul university).doc

Writing Methods (with solutions) For each exercise below, write the method described. Give all of the methods public visibility. Assume all ranges are inclusive (include both end points). Write a method called powersOfTwo that prints the first 10 powers of 2 (starting with 2). The method takes no parameters and doesnt return anything. public void powersOfTwo () { int power = 1; for (int count=1; count = 10; count++) { power *= 2; System.out.println (power); } } Write a method called alarm that prints the word “Alarm!” multiple times on separate lines. The method

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档