473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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.isEmpty())

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(myList);

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(myList);

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(myList);

}

}

return 0;

} //main
Jul 17 '05 #1
5 2018
There is a fortran to java translator so if you
convert your program to fortran it is a snap.
"Angela K" <cr*****@shaw.ca> wrote in message
news:W5Amb.177648$6C4.69738@pd7tw1no...
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.isEmpty())

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(myList);

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(myList);

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(myList);

}

}

return 0;

} //main

Jul 17 '05 #2
where would i find a C++ to fortran and a fortran to java convertor? I
searched google and couldnt find anything.

"Phil..." <ry***@ieee.org> wrote in message
news:tsAmb.25756$Fm2.12789@attbi_s04...
There is a fortran to java translator so if you
convert your program to fortran it is a snap.
"Angela K" <cr*****@shaw.ca> wrote in message
news:W5Amb.177648$6C4.69738@pd7tw1no...
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.isEmpty())

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(myList);

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(myList);

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(myList);

}

}

return 0;

} //main


Jul 17 '05 #3
I don't know about C++ to FORTRAN, but I may have
been too hasty about the FORTRAN to java. I found this site
http://netlib.bell-labs.com/netlib/java/index.html
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" <cr*****@shaw.ca> wrote in message
news:gxBmb.178505$pl3.11349@pd7tw3no...
where would i find a C++ to fortran and a fortran to java convertor? I
searched google and couldnt find anything.

"Phil..." <ry***@ieee.org> wrote in message
news:tsAmb.25756$Fm2.12789@attbi_s04...
There is a fortran to java translator so if you
convert your program to fortran it is a snap.
"Angela K" <cr*****@shaw.ca> wrote in message
news:W5Amb.177648$6C4.69738@pd7tw1no...
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.isEmpty())

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(myList);

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(myList);

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(myList);

}

}

return 0;

} //main



Jul 17 '05 #4
Angela K wrote:
I need to translate this code into java, can anyone do it?


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


Jul 17 '05 #5
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" <cr*****@shaw.ca> wrote in message news:<W5Amb.177648$6C4.69738@pd7tw1no>...
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.isEmpty())

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(myList);

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(myList);

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(myList);

}

}

return 0;

} //main

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Angela K | last post by:
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> &...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
133
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
5
by: TZESENG | last post by:
DECEMBER 13, 2005 . Editions: N. America | Europe | Asia | Edition Preference News Analysis By Steve Hamm Source: http://www.businessweek.com/technology/content/dec2005/tc20051213_042973.htm...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
0
by: r035198x | last post by:
Inheritance We have already covered one important concept of object-oriented programming, namely encapsulation, in the previous article. These articles are not articles on object oriented...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.