Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose we have a text file named persons.txt containing information about a collection of persons. A sample of the data is shown below: P01; Jane

image text in transcribed

Suppose we have a text file named persons.txt containing information about a collection of persons. A sample of the data is shown below: P01; Jane Smith; drawing, playing piano; Melbourne P02; Tom Brown; gardening; Sydney P03; Bob Carter; drinking, dancing, running; Sydney P04; Frank Dawson; playing electronic games, soccer; Melbourne A line contains the following details about a person: the person's id, name, hobbies (separated by commas), and city of residence. Write a program that reads the text file and displays on the screen the persons' details as shown in the sample below: P01 Jane Smith Melbourne 2 P02 Tom Brown Sydney 1 P03 Bob Carter Sydney 3 P04 Frank Dawson Melbourne 2 That is, for each person, the method displays The id and the name on the first line, The city of residence on the second line, and The number of hobbies on the third line

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago