CS1113_Homework 6 # 3

CS1113_Homework 6 # 3 - // Declare named constants double...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 // Matt Hergenrether // Section 10 // CS 1113 // April 10, 2008 // Homework 6 # 3 // finds the max value in a list of n numbers import java.util.* // util contains the Scanner class public class Maximum { public static void main(String[] args) { Scanner scan = new Scanner(System.in)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // Declare named constants double value, valMax = int n n = scan.nextInt() valMax = scan.nextDouble() for(int j = 0 j < n-1 j++) { value = scan.nextDouble() if(value > valMax) { valMax = value } } } // End of Main } //End of class...
View Full Document

Ask a homework question - tutors are online