code, JAVA Programming

pls telme source code for Padovan String
Posted Date: 9/1/2012 2:34:49 AM | Location : United States

package test.padovanstring;

public class PadovanString {
public int stringOccurrences(int n, String str){

if(n >= 40)
return -1;
return -1;
String res=pad(n);
return(res.length() - res.replaceAll(str,"").length())/(str.length());
public String pad(int n){
if(n == 0) return "X";
if(n == 1) return "Y";
if(n == 2) return "Z";
else return pad(n-2) + pad(n-3);

public static void main(String []args)
PadovanString p = new PadovanString();
Posted by gourav | Posted Date: 9/7/2012 11:48:55 AM

Related Discussions:- code, Assignment Help, Ask Question on code, Get Answer, Expert's Help, code Discussions

Write discussion on code
Your posts are moderated
Related Questions

In this assignment I would like to have java code that would have either JFrame or something similar with multiple buttons like "BaseCase", "CoalLosses", "Demand", "NoCT,nuclear",

Explain data entry issues? DATA ENTRY: There is new data entered every day. New customers are added every day. Some of the data entry needs the manual entry within computer s

If any of the above conditions does not met, then the program will generate compilation errors. Today Rahul has written his first program "Hello World", but he is not sure about th

Im not in the line of computer science.But i would like to have some knowledge about the computer language "JAVA".I aldredy learns the computer languages "C,C++".So kindly help me

I am supposed to call an external application (which is command-line based) and send input to the application from java. I created a batch file to call the application. It successf

Consider the following C++ template class. #include using namespace std; template class SortedList { public: SortedList() {size = 0;} void insert(T item); friend ostrea

Project Description: Two co-founders are in search of a developer to join us to launch a tech startup. We have experience at fortune 500 companies, elite consulting firms, etc.,