-1

Just started a programming class a few months ago, and I'm going over some review questions for a test. I'm not sure how to tackle this one. We have to format a few lines of text.

So something that looks like this: 2002/Bourne Identity/Action/1:58

Will have to look like this: 2002 - Bourne Identity Action 118 minutes

There are a few of these, and then we have to add up the total running time for each genre. Would I be right in using the split function here?

Thanks

Cuberonix
  • 33
  • 8

1 Answers1

0

I am assuming that the input data are 4 variables. For example

public String parse(Integer year, String title, String genere, Date duration)

So you just have to operate the values. For example

return year + " - " + title + " " + genere + " " + toMinutes(duration) + " minutes"

where toMinutes(duration) is a function which parse a date to minutes.

JCalcines
  • 1,236
  • 12
  • 25