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 “ which contains objects of Persons. Each object contains information about name, weight, height, and status=” ”. Your job is to write a java program that performs the following tasks: 1- Read the file “ ” 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 “ ” and store all the normal weight persons into the file “ ”. 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