HelpSession_1_Quiz_Three_Key-1

HelpSession_1_Quiz_Three_Key-1 - For example, calling...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Help Session for Quiz Three Key: Gloria Townsend 1) Write a method called displayChart that has two integer parameters start and finish . (Assume that start's value is less than finish's.) The method will print two labels, number and triple. The method will then print to the monitor the integer value of start and its triple. One the next lines, it will continue the pattern for each number between start and finish, where the last line is the value of finish and its triple. (Don't worry about spacing!)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: For example, calling displayChart(3, 5) will cause the following chart to appear: Number Triple 3 9 4 12 5 15 For example, calling displayChart(2, 6) will cause the following char to appear: Number Triple 2 6 3 9 4 12 5 15 6 18 public void displayChart(int start, int finish) { System.out.println("Number Triple"); while (start <= finish) { System.out.println(start + " " + start * 3); start++; } } Hello! x = 1 3 x = 2 x = 3 x = 4 x = 4 x = 4 y is getting big! x = 1 y = 26 4. 5. false...
View Full Document

This note was uploaded on 04/17/2008 for the course COMPUTER S 121 taught by Professor Townsend during the Fall '07 term at DePauw.

Ask a homework question - tutors are online