DOC PREVIEW
UNF COP 2551 - Study Notes

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

COP 2551 – Introduction to OOP Program #5 Due: Friday, 3 December 2010Please note: There is no ‘late turnin.’ Note: This is an easy program; worth 90 points. This is essentially a C program. You will only need a Main class with one additional static method (see below). Its main purpose is to acquaint you with 2d arrays, and that’s it. Very straightforward.Using NetBeans 6.7.1 or later version you are to write a Java program using OOP principles to accommodate the following functionalityUsing the input file Countries.txt, you are to build a 4 by X array of integers, average the numbers in each row and display the array and averages. Each record in the input file hastwo fields of interest to you necessary to build your two-dimensional array: the region number and the population. (You will need a substring to extract those two numbers, as in Program 4)Task 1: Build a Two-Dimensional Array. Build a 4by X array such that each row contains a list of integers for ‘that’ region.Specifically, row 1 would have six columns: 480000 720000 500000 100000 1360000 and 15000 namely arrayName (0,0), (0,1), (0,2), etc. that is, all the populations from countries that were in region 1. Your second row will have all the populations from thosecountries that are in region 2, etc. Since there are four regions, your two-dimensional array will have four rows. The number of columns depends on the number of countries in that region. Thus you will have a ragged array.Task 2: Print out the Two-Dimensional Array.You may use the routines in your book discussed at length in class. These are very close to exactly what you will need. See comments below on printing out headers to make this look nice.Task 3: Average the populations per row.Write a method that expects you to pass it a single row of the array, like the parameter: arrayName[i] and returns the average population of those entries in that row (or equivalently in that Region. Call the method four times, once for each row in your array. Each time you call this method, pass the average population back to main each time as aninteger.Task 4: Print the average population of each regionWhen the method described in task 3 returns the integer population, merely print out this integer. For all tasks: Please do format the output and all outputs with a header that clearly describes the detail lines underneath.Grade Sheet for Program 5COP 2551Fall 2010Name: ________________________Source Code – 30 points Points earned: __________IndentationInternal commentsScope terminators Overall program structure Javadoc – 10 points Points earned: __________Appropriateness and completeness of commentsSee link on my web page. Follow the procedure. Be sure to include Javadoc comments in your source code before you generate the Javadoc.Each method must be preceded with Javadoc statements and these need to bevisible in the generated Javadoc .html files.UML – 10 points Points earned: __________Correctness, associations, completeness. This means that the classes you identify are correct, that associations are indicated, and that the attributes and methods are documented within the classes.Outputs – 40 points Points earned: __________Accuracy and Format; Are they correctSkip lines in between displayed numbers for readability. Make the output look professional!Include headers / descriptors as you may feel appropriate. Please start early. Note the due date. You have plenty of time if you start right away. Program must run totally and correctly to receive a passing grade. Do a little (one step) at a


View Full Document

UNF COP 2551 - Study Notes

Download Study Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?