Use Java techniques to create and use methods and Objects.

computer science


  1. Project Objectives: 

  2. • Creating a Class and its methods 

  3. • Passing data to a method and a method of an Object 

  4. • Receiving data from a method of an Object 

  5. • File I/O, Decision structures, Loops, and Arrays

Problem Description: 

Use Java techniques to create and use methods and Objects. We are going to revisit and rework the last project, but this time using a class and allowing the user to specify the file names and how many heart rates there are per community member. You will be creating a P5Driver class and a regular Class called Member. The P5Driver will contain the main method and will drive the actions and logic of the program. The Member class will be used to represent and store the data of each community member. You will once again be calculating the average heart rate. Do not hardcode values, all information should come from the user or from reading from the files. 

The Member class: 

You will need the following attributes/variables: A community members name, an array to store each of the members heart rates (the length of the array should be 50 and the only hardcoded value), an average heart rate of a member (not known until it is calculated by your code), and the logical length of the array. You must have the following methods in this class! 

• An empty Constructor that initializes the variables with non-values 

• * You do not need a non-empty Constructor for this project 

• A set method for each attribute/variable 

• An add heart rate method for the array 

• A get method for each attribute/variable

Related Questions in computer science category