import java.util.Scanner;

public class ConvertDate


    Scanner console = new Scanner(System.in);
    public static void main(String[] args)
        // Inputs the month, day, and year
        ConvertDate.prompt("Enter date to be converted: ");
        String date = ConvertDate.readLine();
        // Trims the extra spaces
        String dte = date.trim();
        // Creates the minimum space between the characters
        int index1 = dte.indexOf(" ");
        int index2 = dte.lastIndexOf(" ");
        /* This is where the letters of the month are going to be store at in the output as well as capitalizing the first letter
         of the month */
        String firstLetter = dte.substring(0,1);
        String otherLetters = dte.substring(1);
        String dte0 = firstLetter.trim().toUpperCase() + otherLetters.trim().toLowerCase();
        // Trims the extra spaces from the date
         String dte1 = dte0.trim().substring(0, index1);
        String dte2 = dte.trim().substring(index1 + 1, index1 + 4);
        String dte3 = dte.trim().substring(index2 + 1);
        // Gives the output of an accurate date without any extra spaces
        System.out.println("Converted Date: " + dte2 + " " + dte1 + " " + dte3);

the error are at ConvertDate.prompt and ConvertDate.readLine and says that create a method prompt(String) and redLine(String) i dont know what to do

2 Years
Discussion Span
Last Post by stultuske

your scanner object is supposed to read input from users, not an object of your class that has not even been decleared
I'd suggest you start again from this point, and ask about any line you add in your code that you are not sure about

import java.util.Scanner;
public class HelloWorld{

     public static void main(String []args){
     public static String getInput(){
         Scanner scanner = new Scanner(System.in);
         return scanner.nextLine();

since we don't know the code of ConvertDate, we can't be sure. for all we know, this are static methods in a class calling ConvertDate which has it's own instance of Scanner

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.