Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Convert Help
Index -> Programming, Java -> Java Help
Goto page Previous  1, 2, 3  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Sun Jan 16, 2005 6:45 pm   Post subject: (No subject)

java wrote:
wtd wrote:
The thing is, people here are reluctant to just give away complete source code. It's just asking for plagiarism, and we don't want to alienate teachers because we believe that compsci.ca can be a great learning tool.

If we help with plagiarism, teachers will tell students not to frequent this site and we'll lose an opportunity to help.


My teacher told me that I may use someone elses code, although I might lose some marks because the code is not completely mine, but I have to give them credit for it. So if you do decide to help me, I will guarantee you that I will place comment lines stating that I received this portion of code from you.

Andy wrote:
sry the code i posted last time was slitely buggy.. sory for the inconvenience
code:

        int num=1111;
        char hexletter[17]="0123456789ABCDEF";
        char hex;
        hex=hexletter[(num/125)+((num%1000)-(num%100))/25+((num%100)-(num%10))/5+(num%10)];


this only works for four digit binary numbers


When I use this code I get a Syntax Error: Unexpected Symbol Ignored on this part char hexletter[17]="0123456789ABCDEF";


What are you using to compile this?
Sponsor
Sponsor
Sponsor
sponsor
java




PostPosted: Sun Jan 16, 2005 8:13 pm   Post subject: (No subject)

wtd wrote:
What are you using to compile this?


I dont understand your question.
wtd




PostPosted: Sun Jan 16, 2005 8:28 pm   Post subject: (No subject)

java wrote:
wtd wrote:
What are you using to compile this?


I dont understand your question.


Are you using the standard Java tools from Sun, or Ready to Program?
Andy




PostPosted: Sun Jan 16, 2005 9:33 pm   Post subject: (No subject)

i dunno that code works fine in c++.. i dont have a java compiler installed so i couldnt test it... wtd does it work with eclipse or jcreator?
rizzix




PostPosted: Sun Jan 16, 2005 9:34 pm   Post subject: (No subject)

jeez. why would that matter? huh? Confused
java




PostPosted: Sun Jan 16, 2005 10:00 pm   Post subject: (No subject)

I use Ready to Program
wtd




PostPosted: Sun Jan 16, 2005 11:17 pm   Post subject: (No subject)

java wrote:
I use Ready to Program


Well, there's your problem.

:: sigh ::
java




PostPosted: Mon Jan 17, 2005 2:16 pm   Post subject: (No subject)

wtd wrote:


Well, there's your problem.

:: sigh ::


Crying or Very sad Then what am I supposed to do?
Sponsor
Sponsor
Sponsor
sponsor
McKenzie




PostPosted: Mon Jan 17, 2005 4:03 pm   Post subject: (No subject)

The problem has nothing to do with the compiler. Andy wrote C++ code. You need to convert that to Java. You need to know how to use strings in Java. e.g. instead of:
code:
char hexletter[17]="0123456789ABCDEF";

use:
code:
String hexletter="0123456789ABCDEF";

There are other minor changes, but you need to know enough Java to overcome them.
Andy




PostPosted: Mon Jan 17, 2005 6:53 pm   Post subject: (No subject)

wait.. so u cant have an character array style string in java?
rizzix




PostPosted: Mon Jan 17, 2005 6:56 pm   Post subject: (No subject)

no u can only have a character style array in java:
code:
char[4] theChars = {'a', 'b', 'c', '\0'};
Andy




PostPosted: Mon Jan 17, 2005 7:03 pm   Post subject: (No subject)

Oooo.. the [] has to be beside the char.. thats y it didnt work on my friends compiler.. thx rizzix
java




PostPosted: Mon Jan 17, 2005 10:54 pm   Post subject: (No subject)

a
a
Andy




PostPosted: Tue Jan 18, 2005 5:58 pm   Post subject: (No subject)

read what rizzix wrote, and use that instead of my way of declaring the character array.. if u still dont get it then post here.. but at least try yourself
java




PostPosted: Tue Jan 18, 2005 8:30 pm   Post subject: (No subject)

Andy wrote:
read what rizzix wrote, and use that instead of my way of declaring the character array.. if u still dont get it then post here.. but at least try yourself


I read what he wrote about the char array, but I don't understand it. I'm not the best at Java, so can you help me out by telling me what to put in my code and where. That would really help me out because I've been trying but getting no-where.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 3  [ 31 Posts ]
Goto page Previous  1, 2, 3  Next
Jump to:   


Style:  
Search: