CS1113_Homework 8 # 1

CS1113_Homework 8 # 1 - for(int x=0 { dB[x] = Math.random()...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 // Matt Hergenrether // Section 10 // CS 1113 // April 22, 2008 // Homework 8 # 1 // Deals with an array import java.util.* public class Array { public static void main(String[] args) { Scanner scan = new Scanner(System.in) // Declare named constants final int ARR_SIZE = 30 // Declare variables int n=0 double[] dB = new double[ARR_SIZE] double[] dC = new double[ARR_SIZE] if(scan.hasNextInt()) { n = scan.nextInt() } else { System.out.println("Error: no n value") System.exit(0) } { System.out.println("It found n to be less then db and dc")
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for(int x=0 { dB[x] = Math.random() } for(int x=0 { System.out.println(dB[x]) } for(int x=0 { dC[x] = dB[x] Sheet1 Page 2 } for(int x=0 { System.out.println(dC[x]) } } else { System.out.println("ERROR: n is not less than or equal to the length of the array") System.exit(0) } } // End of Main } //End of class Sheet1 Page 3 // util contains the Scanner class x <= n-1 x++) x <= n-1 x++) x <= n-1 x++) Sheet1 Page 4 x <= n-1 x++)...
View Full Document

This note was uploaded on 09/28/2011 for the course CS 1113 taught by Professor Chandler during the Fall '08 term at Oklahoma State.

Page1 / 4

CS1113_Homework 8 # 1 - for(int x=0 { dB[x] = Math.random()...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online