Hey there, I want to develop a Mobile Dictionary App for Android for a school pr
ID: 3750866 • Letter: H
Question
Hey there, I want to develop a Mobile Dictionary App for Android for a school progject. Can you help me with a code (preferably made in Java or Phython). The purpose of this is to be able to input a word and find the meaning also a sentence to show how the word is used.
For Example
Word: Hello
Definition: used as a greeting or to begin a telephone conversation.
Sentence: tom told me to tell you hello today.
Also it should be able to display Synonyms
Example
Word: Hello
Synonym: greetings, hi, howdy etc....
Program should also have a welcome screen that says:
"Welcome choose a program
1. Definition
2. Synonym
3. Close App"
At the end of finding a definition or synonym there should be an option to return to the main menu.
App should also have the following features:
Sould clips for prouniciation
Etymologies
Autocomplete suggestions
Photos (where applicable)
Thank You.
Explanation / Answer
I have a sample code, which will work for this above given case by you, If you want to make it generic take a map for each word what will be greeting or definition, these you need to store.
This below code is written in java you can run and compile it , it will run until you will use 3rd option stop app .
/*package whatever //do not write package name here */
import java.io.*;
import java.util.Scanner;
class MobileDictionaryApp {
public static void main (String[] args) {
while(true){
System.out.println(""Welcome choose a program");
System.out.println("1. Definition");
System.out.println("2. Synonym");
System.out.println("3. Close App"");
//Here user can select any one of the option out of these 3 option
//to choose any option just enter 1,2 or 3.
//if user enter any number which is not in this range of 1-3 then show that its just exit the code.
Scanner sc = new Scanner(System.in);
int choice = sc.nextInt();
sc.nextLine();
String word = sc.nextLine();
System.out.println(word);
//Here you can either take a map according to your MobileDictionaryApp requirement
//for example here I can take example of word :Hello
if(choice == 1){//it means it Definition
System.out.println("used as a greeting or to begin a telephone conversation.");
}
else if(choice == 2){
System.out.println("greetings, hi, howdy etc....");
}
else{
break;
}
}
}
}