Whoever loves C++ and java programming, come here

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Angela K

    Whoever loves C++ and java programming, come here

    I need to translate this code into java, can anyone do it?

    #include <iostream.h>

    #include "LinkedList .h"

    #include "mystring.h "



    template <class Object>

    void printList(const List<Object> & theList) {

    if(theList.isEm pty())

    cout << "The List is Empty, Dude!!" << endl;

    else {

    ListItr<Object> itr = theList.first() ;

    for( ; !itr.isPastEnd( ); itr.advance())

    cout << itr.retrieve() << " ";

    } //printing list in else statement

    cout << endl;

    } // print list



    int main() {

    string x;

    List<string> myList;

    ListItr<string> theItr = myList.zeroth() ;

    int i = 0;



    printList(myLis t);



    cout << "Enter string values, seperated by whitespace." << endl;

    cout << "ctrl-d by itself on a line will terminate the process." << endl;

    cout << "Watch the List Building Up in Progress!!" << endl;



    while (cin >> x) {

    myList.insert(x , theItr);

    printList(myLis t);

    theItr.advance( );

    i++;

    }



    cout << endl;

    cout << "Traverse the Entire List.Remove the names(nodes) that begin with

    the character" << endl;

    cout << "\"a\"" << endl;

    cout << "Watch the List Shrinkage in Progress!!" << endl;

    cout << endl;



    string y;

    string a = "a";



    ListItr<string> tItr = myList.first();

    for( ; !tItr.isPastEnd (); tItr.advance()) {

    y = tItr.retrieve() ;

    if(y[0] == a[0]) {

    myList.remove(y );

    printList(myLis t);

    }

    }



    return 0;

    } //main


  • Phil...

    #2
    Re: Whoever loves C++ and java programming, come here

    There is a fortran to java translator so if you
    convert your program to fortran it is a snap.


    "Angela K" <crxgurl@shaw.c a> wrote in message
    news:W5Amb.1776 48$6C4.69738@pd 7tw1no...[color=blue]
    > I need to translate this code into java, can anyone do it?
    >
    > #include <iostream.h>
    >
    > #include "LinkedList .h"
    >
    > #include "mystring.h "
    >
    >
    >
    > template <class Object>
    >
    > void printList(const List<Object> & theList) {
    >
    > if(theList.isEm pty())
    >
    > cout << "The List is Empty, Dude!!" << endl;
    >
    > else {
    >
    > ListItr<Object> itr = theList.first() ;
    >
    > for( ; !itr.isPastEnd( ); itr.advance())
    >
    > cout << itr.retrieve() << " ";
    >
    > } //printing list in else statement
    >
    > cout << endl;
    >
    > } // print list
    >
    >
    >
    > int main() {
    >
    > string x;
    >
    > List<string> myList;
    >
    > ListItr<string> theItr = myList.zeroth() ;
    >
    > int i = 0;
    >
    >
    >
    > printList(myLis t);
    >
    >
    >
    > cout << "Enter string values, seperated by whitespace." << endl;
    >
    > cout << "ctrl-d by itself on a line will terminate the process." <<[/color]
    endl;[color=blue]
    >
    > cout << "Watch the List Building Up in Progress!!" << endl;
    >
    >
    >
    > while (cin >> x) {
    >
    > myList.insert(x , theItr);
    >
    > printList(myLis t);
    >
    > theItr.advance( );
    >
    > i++;
    >
    > }
    >
    >
    >
    > cout << endl;
    >
    > cout << "Traverse the Entire List.Remove the names(nodes) that begin[/color]
    with[color=blue]
    >
    > the character" << endl;
    >
    > cout << "\"a\"" << endl;
    >
    > cout << "Watch the List Shrinkage in Progress!!" << endl;
    >
    > cout << endl;
    >
    >
    >
    > string y;
    >
    > string a = "a";
    >
    >
    >
    > ListItr<string> tItr = myList.first();
    >
    > for( ; !tItr.isPastEnd (); tItr.advance()) {
    >
    > y = tItr.retrieve() ;
    >
    > if(y[0] == a[0]) {
    >
    > myList.remove(y );
    >
    > printList(myLis t);
    >
    > }
    >
    > }
    >
    >
    >
    > return 0;
    >
    > } //main
    >
    >[/color]


    Comment

    • Angela K

      #3
      Re: Whoever loves C++ and java programming, come here

      where would i find a C++ to fortran and a fortran to java convertor? I
      searched google and couldnt find anything.

      "Phil..." <rynes@ieee.org > wrote in message
      news:tsAmb.2575 6$Fm2.12789@att bi_s04...[color=blue]
      > There is a fortran to java translator so if you
      > convert your program to fortran it is a snap.
      >
      >
      > "Angela K" <crxgurl@shaw.c a> wrote in message
      > news:W5Amb.1776 48$6C4.69738@pd 7tw1no...[color=green]
      > > I need to translate this code into java, can anyone do it?
      > >
      > > #include <iostream.h>
      > >
      > > #include "LinkedList .h"
      > >
      > > #include "mystring.h "
      > >
      > >
      > >
      > > template <class Object>
      > >
      > > void printList(const List<Object> & theList) {
      > >
      > > if(theList.isEm pty())
      > >
      > > cout << "The List is Empty, Dude!!" << endl;
      > >
      > > else {
      > >
      > > ListItr<Object> itr = theList.first() ;
      > >
      > > for( ; !itr.isPastEnd( ); itr.advance())
      > >
      > > cout << itr.retrieve() << " ";
      > >
      > > } //printing list in else statement
      > >
      > > cout << endl;
      > >
      > > } // print list
      > >
      > >
      > >
      > > int main() {
      > >
      > > string x;
      > >
      > > List<string> myList;
      > >
      > > ListItr<string> theItr = myList.zeroth() ;
      > >
      > > int i = 0;
      > >
      > >
      > >
      > > printList(myLis t);
      > >
      > >
      > >
      > > cout << "Enter string values, seperated by whitespace." << endl;
      > >
      > > cout << "ctrl-d by itself on a line will terminate the process." <<[/color]
      > endl;[color=green]
      > >
      > > cout << "Watch the List Building Up in Progress!!" << endl;
      > >
      > >
      > >
      > > while (cin >> x) {
      > >
      > > myList.insert(x , theItr);
      > >
      > > printList(myLis t);
      > >
      > > theItr.advance( );
      > >
      > > i++;
      > >
      > > }
      > >
      > >
      > >
      > > cout << endl;
      > >
      > > cout << "Traverse the Entire List.Remove the names(nodes) that begin[/color]
      > with[color=green]
      > >
      > > the character" << endl;
      > >
      > > cout << "\"a\"" << endl;
      > >
      > > cout << "Watch the List Shrinkage in Progress!!" << endl;
      > >
      > > cout << endl;
      > >
      > >
      > >
      > > string y;
      > >
      > > string a = "a";
      > >
      > >
      > >
      > > ListItr<string> tItr = myList.first();
      > >
      > > for( ; !tItr.isPastEnd (); tItr.advance()) {
      > >
      > > y = tItr.retrieve() ;
      > >
      > > if(y[0] == a[0]) {
      > >
      > > myList.remove(y );
      > >
      > > printList(myLis t);
      > >
      > > }
      > >
      > > }
      > >
      > >
      > >
      > > return 0;
      > >
      > > } //main
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Phil...

        #4
        Re: Whoever loves C++ and java programming, come here

        I don't know about C++ to FORTRAN, but I may have
        been too hasty about the FORTRAN to java. I found this site
        🔑Surf like a Boss! Unleash the indomitable power of our lightning-fast, rock-solid VPN shield. Maximum cybersecurity and privacy protection. Built on WireGuard

        that claims to have a directory of stuff for "FORTRAN to java" but
        I just checked it out and it seems to be just stuff for the math library.
        I believe they do have a translator, but I have not found it.

        "Angela K" <crxgurl@shaw.c a> wrote in message
        news:gxBmb.1785 05$pl3.11349@pd 7tw3no...[color=blue]
        > where would i find a C++ to fortran and a fortran to java convertor? I
        > searched google and couldnt find anything.
        >
        > "Phil..." <rynes@ieee.org > wrote in message
        > news:tsAmb.2575 6$Fm2.12789@att bi_s04...[color=green]
        > > There is a fortran to java translator so if you
        > > convert your program to fortran it is a snap.
        > >
        > >
        > > "Angela K" <crxgurl@shaw.c a> wrote in message
        > > news:W5Amb.1776 48$6C4.69738@pd 7tw1no...[color=darkred]
        > > > I need to translate this code into java, can anyone do it?
        > > >
        > > > #include <iostream.h>
        > > >
        > > > #include "LinkedList .h"
        > > >
        > > > #include "mystring.h "
        > > >
        > > >
        > > >
        > > > template <class Object>
        > > >
        > > > void printList(const List<Object> & theList) {
        > > >
        > > > if(theList.isEm pty())
        > > >
        > > > cout << "The List is Empty, Dude!!" << endl;
        > > >
        > > > else {
        > > >
        > > > ListItr<Object> itr = theList.first() ;
        > > >
        > > > for( ; !itr.isPastEnd( ); itr.advance())
        > > >
        > > > cout << itr.retrieve() << " ";
        > > >
        > > > } //printing list in else statement
        > > >
        > > > cout << endl;
        > > >
        > > > } // print list
        > > >
        > > >
        > > >
        > > > int main() {
        > > >
        > > > string x;
        > > >
        > > > List<string> myList;
        > > >
        > > > ListItr<string> theItr = myList.zeroth() ;
        > > >
        > > > int i = 0;
        > > >
        > > >
        > > >
        > > > printList(myLis t);
        > > >
        > > >
        > > >
        > > > cout << "Enter string values, seperated by whitespace." << endl;
        > > >
        > > > cout << "ctrl-d by itself on a line will terminate the process." <<[/color]
        > > endl;[color=darkred]
        > > >
        > > > cout << "Watch the List Building Up in Progress!!" << endl;
        > > >
        > > >
        > > >
        > > > while (cin >> x) {
        > > >
        > > > myList.insert(x , theItr);
        > > >
        > > > printList(myLis t);
        > > >
        > > > theItr.advance( );
        > > >
        > > > i++;
        > > >
        > > > }
        > > >
        > > >
        > > >
        > > > cout << endl;
        > > >
        > > > cout << "Traverse the Entire List.Remove the names(nodes) that[/color][/color][/color]
        begin[color=blue][color=green]
        > > with[color=darkred]
        > > >
        > > > the character" << endl;
        > > >
        > > > cout << "\"a\"" << endl;
        > > >
        > > > cout << "Watch the List Shrinkage in Progress!!" << endl;
        > > >
        > > > cout << endl;
        > > >
        > > >
        > > >
        > > > string y;
        > > >
        > > > string a = "a";
        > > >
        > > >
        > > >
        > > > ListItr<string> tItr = myList.first();
        > > >
        > > > for( ; !tItr.isPastEnd (); tItr.advance()) {
        > > >
        > > > y = tItr.retrieve() ;
        > > >
        > > > if(y[0] == a[0]) {
        > > >
        > > > myList.remove(y );
        > > >
        > > > printList(myLis t);
        > > >
        > > > }
        > > >
        > > > }
        > > >
        > > >
        > > >
        > > > return 0;
        > > >
        > > > } //main
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Brad BARCLAY

          #5
          Re: Whoever loves C++ and java programming, come here

          Angela K wrote:[color=blue]
          > I need to translate this code into java, can anyone do it?[/color]

          I'm sure lots of people here can. What is the job paying?

          Brad BARCLAY

          --
          =-=-=-=-=-=-=-=-=
          From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
          The jSyncManager Project: http://www.jsyncmanager.org
          

          Comment

          • Jim Flath

            #6
            Re: Whoever loves C++ and java programming, come here

            Have you got a solution to this yet? It would be fairly simple Java
            code, let me know if you still need it and I will email it to you.


            "Angela K" <crxgurl@shaw.c a> wrote in message news:<W5Amb.177 648$6C4.69738@p d7tw1no>...[color=blue]
            > I need to translate this code into java, can anyone do it?
            >
            > #include <iostream.h>
            >
            > #include "LinkedList .h"
            >
            > #include "mystring.h "
            >
            >
            >
            > template <class Object>
            >
            > void printList(const List<Object> & theList) {
            >
            > if(theList.isEm pty())
            >
            > cout << "The List is Empty, Dude!!" << endl;
            >
            > else {
            >
            > ListItr<Object> itr = theList.first() ;
            >
            > for( ; !itr.isPastEnd( ); itr.advance())
            >
            > cout << itr.retrieve() << " ";
            >
            > } //printing list in else statement
            >
            > cout << endl;
            >
            > } // print list
            >
            >
            >
            > int main() {
            >
            > string x;
            >
            > List<string> myList;
            >
            > ListItr<string> theItr = myList.zeroth() ;
            >
            > int i = 0;
            >
            >
            >
            > printList(myLis t);
            >
            >
            >
            > cout << "Enter string values, seperated by whitespace." << endl;
            >
            > cout << "ctrl-d by itself on a line will terminate the process." << endl;
            >
            > cout << "Watch the List Building Up in Progress!!" << endl;
            >
            >
            >
            > while (cin >> x) {
            >
            > myList.insert(x , theItr);
            >
            > printList(myLis t);
            >
            > theItr.advance( );
            >
            > i++;
            >
            > }
            >
            >
            >
            > cout << endl;
            >
            > cout << "Traverse the Entire List.Remove the names(nodes) that begin with
            >
            > the character" << endl;
            >
            > cout << "\"a\"" << endl;
            >
            > cout << "Watch the List Shrinkage in Progress!!" << endl;
            >
            > cout << endl;
            >
            >
            >
            > string y;
            >
            > string a = "a";
            >
            >
            >
            > ListItr<string> tItr = myList.first();
            >
            > for( ; !tItr.isPastEnd (); tItr.advance()) {
            >
            > y = tItr.retrieve() ;
            >
            > if(y[0] == a[0]) {
            >
            > myList.remove(y );
            >
            > printList(myLis t);
            >
            > }
            >
            > }
            >
            >
            >
            > return 0;
            >
            > } //main[/color]

            Comment

            Working...