CSC-113-Tutorial 10 - 2-Compute the status of each person...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
KSU / CCIS / CS DEPARTMENT CSC-113, SPRING 2010 TUTORIAL 10 – File Input and Output Exercise: We consider a class Person presented in the following UML. We have a file called “ person.data which contains objects of Persons. Each object contains information about name, weight, height, and status=” ”. Your job is to write a java program PersonMainTest.java that performs the following tasks: 1- Read the file “ person.data ” to extract all person objects and put them into an array of objects.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2-Compute the status of each person using the following rule. If weight / (height)^2 > 27  status is “Obese” IfNot the status will be “Normal Weight ”. 3-Store all the obese persons into the file “ obese.data ” and store all the normal weight persons into the file “ normal.data ”. Person -name : String -height: double -weight : double -status : String +Person(na: String, double h, double w) + sets… all + gets. . all...
View Full Document

This note was uploaded on 11/28/2011 for the course COMPUTER S 113 taught by Professor Dr.safwanqasem during the Spring '11 term at King Saud University.

Ask a homework question - tutors are online