{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS1113_Homework 8 # 1

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

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

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) } if(n <= dB.length && n <= dC.length) { System.out.println("It found n to be less then db and dc")

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

View Full Document

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

View Full Document
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

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online