CSCE 2013L: Lab 7 - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

CSCE 2013L: Lab 7

Description:

... Average.java, AverageDriver.java, Song.java, CompactDisc.java Be sure to submit from the src directory of your Netbeans project folder ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 6
Provided by: Ebo60
Category:
Tags: 2013l | csce | lab | netbeans

less

Transcript and Presenter's Notes

Title: CSCE 2013L: Lab 7


1
CSCE 2013L Lab 7
  • Overview
  • Arrays in Java
  • Selection Sort
  • Lab Programs
  • Average.java
  • Sort and average 5 integers entered from the
    keyboard
  • AverageDriver.java
  • Use your Average class
  • CompactDisc.java
  • Modify to print out a selection of songs from
    Classics.txt

2
Arrays in Java (Syntax)?
  • Unlike C, the (brackets) go behind the type
    name, not the variable name
  • Declare like
  • int intArray
  • Person people
  • Allocate new memory for like
  • intArray new intsize
  • people new Personsize

3
Arrays in Java cont.
  • When an array of class types is made, keep in
    mind that the array is initially filled with the
    null value (i.e. the cells aren't pointing to
    anything)?
  • Memory for each element still has to be new'ed.
  • Like
  • peoplepos new Person(name, age)

4
Selection Sort (Descending)?
  • Find the highest element in the list and swap it
    with the element at the first position (remember
    to use a temporary variable for the swap)?
  • Move to position (n 1) and repeat this process
    (only, of course, (n 1) is where the value
    needs to be swapped)?

5
Lab Submission
  • How do I submit my assignment?
  • submit csce2013-005 elb02 lab7
  • if you are enrolled in the Wednesday session
  • submit csce2013-004 elb02 lab7
  • if you are enrolled in the Monday session
  • The files I require for this lab are
  • Average.java, AverageDriver.java, Song.java,
    CompactDisc.java
  • Be sure to submit from the src directory of your
    Netbeans project folder
Write a Comment
User Comments (0)
About PowerShow.com