import java.io.*;
class Dictionary
{
public static void main(String[] args)
{
Console console=System.console();
System.out.println("Please enter the next number");
String input;
input=console.readLine();
String[] Hebrew={"ehad", "shnaiim","shalosh","arba","hamesh","shesh","sheva","shmone","tesha","eser"};
String[] English={"one", "two","three","four","five","six","seven","eight","nine","ten"};
for(int x=0;x<Hebrew.length;x++)
{ if(input.equals(Hebrew[x]))
{
System.out.println(English[x]);
}
}
}
{
while(!input.equals("enough") ) //i want to make a condition that if the program doesnt find a number it would do this. but it wont allow me too
{
System.out.println("Illegal word, please enter another word");
input=console.readLine();
}
}
}
NewOrder
-1
Posting Whiz
Recommended Answers
Jump to PostSorry dude but we are not mind readers to find out what you trying to do. So post your question.
Jump to Postit wont allow me to
What does this comment mean?
Jump to PostWhat does this comment mean?
NormR1 - i think it means that N_O_ does not understand how to make it work.
N_O_ the reply above will get you a condition, but you do not even need to do that. Just initialize the output string with the did not find …
Jump to PostYou should also consider to use 2d array or better hash map to store your data
Jump to PostHave you thought of trying to design the logic for your program using something like a flowchart?
Most programmers work out the logic of a problem BEFORE trying to write code.
All 17 Replies
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
NewOrder
-1
Posting Whiz
Abdel_eid
-5
Junior Poster in Training
NormR1
563
Posting Sage
Team Colleague
HarryPad
0
Newbie Poster
mnmw
-8
Light Poster
NewOrder
-1
Posting Whiz
mnmw
-8
Light Poster
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
NewOrder
-1
Posting Whiz
NewOrder
-1
Posting Whiz
NormR1
563
Posting Sage
Team Colleague
NewOrder
-1
Posting Whiz
NormR1
563
Posting Sage
Team Colleague
mnmw
-8
Light Poster
NewOrder
-1
Posting Whiz
NormR1
563
Posting Sage
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.