

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Java Programming; Subject: Computer Programming; University: Florida International University; Term: Unknown 1989;
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Due Tuesday, April 15th
int s = 0; int [ ] a = { 12, 48, 65 };
for ( int i = 0; i < a.length; i++ ) s += a[i];
System.out.println( “s = ” + s ); [10 points]
int [ ] a = { 12, 48, 65, 23 }; int temp = a[1]; a[1] = a[3]; a[3] = temp;
for ( int i = 0; i < a.length; i++ ) System.out.println( a[i] + “ ” ); [10 points]
String [ ][ ] cities = {{ “New York”, “LA”, “San Francisco”, “Chicago” }, { “Munich”, “Stuttgart”, “Berlin”, “Bonn” }, { “Paris”, “Ajaccio”, “Lyon” }, { “Montreal”, “Ottawa”, “Vancouver” } };
for ( int i = 0; i < cities.length; i++ ) { for ( int j = 0; j < cities[i].length; j++ ) { if ( cities[i][j].length() == 6 ) System.out.println( cities[i][j] ); [10 points]
public int foo( int [ ] a) { // your code goes here } [20 points]