2. Counting in Lojban, an artificial language developed
over the last fourty years, is easier than in most languages
The numbers from zero to nine are:
0 no
1 pa
2 re
3 ci
4 vo
5 mk
6 xa
7 ze
8 bi
9 so
Larger numbers are created by gluing the digit togather.
For Examle 123 is pareci
Write a program that reads in a lojban string(representing
a no less than or equal to 1,000,000) and output it in
numbers.

Answer Posted / simi

In java We can do the same as
int getIntValueForString(Stirng str){
if("AB".equals(str))return 0;
.
.
.
.
.
if("rs".equals(str))return 9;
}
public static void main(Stirng [args]){
//get the String as an input from the user
//Call the method to get the int
String intValue = getIntValueForLojbanString(inputString , 0);
}
Stirng getIntValueForLojbanString(String inputString ,
String Value){
int i=0;
String intValue = new intvalue();
if(inputString != null || inputString.length()==0) return
intValue;
else
{
if(Value !=null)
intValue= Value +
getIntValueForString(inputString.chatAt[i]+inputString.chatAt[i+1]).toString();

else
intValue =
getIntValueForString(inputString.chatAt[i]+inputString.chatAt[i+1]).toString();

if(inputString.length()>2)
getIntValueForLojbanString(inputString.subString(i+3) ,
intValue);}
}
}

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a program?

659


write a program to create a sparse matrix using dynamic memory allocation.

4370


What is the difference between int main and void main in c?

589


What the advantages of using Unions?

667


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

656






Write a function that will take in a phone number and output all possible alphabetical combinations

593


What is a loop?

548


Explain what happens if you free a pointer twice?

609


When we use void main and int main?

588


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3498


write a program to rearrange the array such way that all even elements should come first and next come odd

1757


Explain how do you determine a file’s attributes?

588


Why header files are used?

642


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

1588


What is file in c language?

574