1. Engineering
  2. Computer Science
  3. i am stuck on number 5 in the document below...

Question: i am stuck on number 5 in the document below...

Question details

I am stuck on number 5 in the document below. I tried using indexOf and lastIndexOf but its only giving me a 1 I honestly don't know what I am doing wrong.

Here is my code so far, I put zeros at the other variables as I wanted to see what the code outputted.

O3 *ParseTheTweet.java 24 25 import java.util.Scanner; 26 27 public class ParseTheTweet 28 29 public static void main(String[] args) 30 31 32 Scanner keyboardnew Scanner (System.in); System.out.printlIn(Enter the tweet you would like to sort); String tweet keyboard.next; 34 35 36 37 38 39 40 41 42 43 String start(#; String finish ( ); int type = tweet. indexOf (start) ; tweet .lastIndex0f (finish); int detail-0; int location0; int latitude -0; int longitude; 45 46 47 48 System.out.println(type); System.out.println(detail); System.out.println(location); System.out.printIn(latitude) System.out.println (longitude)l 49 50 51 52 53 54 keyboard.close);

http://cobweb.cs.uga.edu/~cs1301/files/Lab03.pdf

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution