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 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.
Jump to PostYou do need to DESIGN it! Flowcharting is a tool to help you design a program.
Without the logic flow worked out before you start coding, you end up with a mess.
QED
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.