Need help desperately
Hey all, I need some help. i am working on a homework assignment and i am stuck here is the assignment.
Real World Strings Class Problem:
Using the following XML file snipette:
<unit>
<frame>
<begin comment="00:00:00">0</begin>
<end comment="00:01:01.5">221400000</end>
</frame>
</unit>
1. Allow for the input of hours, minutes and seconds in 00:00:00.0 format.
2. Parse out the hours, minutes and seconds and convert to milliseconds.
3. Assuming this is a fine tuning, parse the original "begin" or "end" XML statement and insert the original input (00:00:00.0) as the the value for the comment attribute. Insert the calculated milliseconds as the value between the begin or end tags.
4. Output the answer.
Note: You must be able to differentiate between begin or end tag lines.
Hints:
- 60 minutes (01:00:00.0) in an hour
- 60 seconds (00:01:00.0) in a minute
- 1 millisec = 10000 seconds (00:00:01.0)
- Fractions (00:00:00.1) of a second count.
Refinement: Create an error checking method that will determine if the input string is the correct (00:00:00.0) format.
I got past step one with no problem at all, now i am stuck on step 2 i am just not understanding how to do it i looked in my book and that reall didnt help me much. any help you can give me will be great. here is my code so far.
import javax.swing.JOptionPane;
publicclass RealWorldString{
publicstaticvoid main(String[] args)
{
String input= JOptionPane.showInputDialog("Enter a time in 00:00:00 format" ,"00:00:00");
System.exit(0);
}
}

