0
嗨,大家好我想编程一个猪拉丁语翻译,我卡住试图提示用户输入他们输入的短语中的第一个元音。我觉得我没有做好。从java中的单词短语获取元音
当用户输入“白色” 我希望下两个提示要求单词中的第一个元音。然后把它翻译成拉丁文。
有关如何开始的任何建议?谢谢!
这里是我的代码:
import java.util.Scanner;
public class main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Please enter a 2 word phrase: ");
String input = sc.nextLine();
System.out.println("Please enter the first vowel in the first word: ");
String input1 = sc.nextLine();
System.out.println("Please enter the first vowel in the second word: ");
String input2 = sc.nextLine();
}
你有什么问题? – Guy
我觉得我最困惑的是从那里往哪里前进。当我得到元音时,我将如何使用它将我的文字翻译成拉丁文字? – Yellow
不要问用户。找到他们自己并替换他们。想想你会如何在纸上做。 – anaxin