Forum: Perl Sep 17th, 2009 |
| Replies: 3 Views: 535 rand() for random generation
Also
sprintf "%.2f" #if you want 8 digits as decimal places use that |
Forum: Perl Sep 16th, 2009 |
| Replies: 1 Views: 422 Hi I am struggling learning perl and everytime I try to enter stuff in at runtime I keep getting a 1 returned. I dont get it. please can you explain to me what I am doing wrong.
... |
Forum: Perl Sep 15th, 2009 |
| Replies: 2 Views: 469 got it. You cant put calls to subroutines in print statements because it already executes them anyway. |
Forum: Perl Sep 15th, 2009 |
| Replies: 2 Views: 469 I am trying to teach myself perl and I cannot understand why when I print arrays from these subroutines that it prints an extra one that isnt there.
@name=fname(@name)."\n".lname(@name);
... |
Forum: Java Feb 28th, 2008 |
| Replies: 11 Views: 2,341 thnx m8. I have solved it. Your spot on. I wasnt using my methods properly. once I have handed the homework in I will post my solution if ur interested. Until then this is a solved thread and I think... |
Forum: Java Feb 28th, 2008 |
| Replies: 11 Views: 2,341 I changed it in my rectangle class but I am still getting 0.0 when I run my driver class. |
Forum: Java Feb 28th, 2008 |
| Replies: 11 Views: 2,341 Hi guys I am now onto my driver class and it is causing me issues. I need it to show that it can print out the correct area and for the style for the triangle. for the rectangle I just need to print... |
Forum: IT Professionals' Lounge Feb 27th, 2008 |
| Replies: 37 Views: 4,237 hmm good idea. Then see if you get head hunted by a rival company. Then you will be taken much more seriously. Yeah start putting some neat programmes on the web. Make all sorts of stuff either games... |
Forum: Java Feb 26th, 2008 |
| Replies: 11 Views: 2,341 I have to create the rectangle class. I can't inherit it from triangle. |
Forum: Java Feb 26th, 2008 |
| Replies: 11 Views: 2,341 That TwoDShape class I can't change. That was given to me by my lecturer to do this work. the only other things If I have questions they will be on 3 things
1. the calculate area if I keep it the... |
Forum: Java Feb 26th, 2008 |
| Replies: 11 Views: 2,341 Thnx. I am not marking this thread as solved yet because I may have other questions but that means I can now do a big chunk of my coding :-) thnx |
Forum: Java Feb 26th, 2008 |
| Replies: 10 Views: 2,923 don't use stringTokenizer cus that is being wiped out. Use Split. Go to the java API and it will tell you how to use it. |
Forum: Java Feb 26th, 2008 |
| Replies: 11 Views: 2,341 I am currently working on something where I have to make two shapes which extend to a class called 2d shape. I am currently working on my Triangle class which is this:
lass Triangle extends... |
Forum: IT Professionals' Lounge Feb 21st, 2008 |
| Replies: 37 Views: 4,237 cool. Its nice to know. The 1 fear I have is I end up like my lecturers male single and dating alcohol. So what I am trying to learn to do is not talk about computing to non computist cus I have... |
Forum: IT Professionals' Lounge Feb 21st, 2008 |
| Replies: 37 Views: 4,237 Something I have noticed with my uni course is that there are so few women on it. Is there some reason why women stay away from the best part of using a computer IE programming in java?
am I a... |
Forum: Java Feb 21st, 2008 |
| Replies: 2 Views: 717 to convert a string to an real number which you will need with your conversions use double num = Double.parseDouble(enteredString); |
Forum: Java Feb 21st, 2008 |
| Replies: 13 Views: 1,329 well for starters your emp_pos is null also you a_pos isnt defined as anything so try
a_pos = "lol";
emp_pos = a_pos;
then see if that works. |
Forum: Java Feb 21st, 2008 |
| Replies: 5 Views: 629 To print in something like a table format on the command line use "/t" and "/n" in System.out.print();
If you want a table format using a gui then look at the libraries on the JAVA API website. |
Forum: Java Feb 21st, 2008 |
| Replies: 3 Views: 425 sounds to me like a system like that needs to be made using cobol. |
Forum: Java Feb 21st, 2008 |
| Replies: 7 Views: 768 object orientated programming is using objects to code so as to remove the need for global variables, create better securer code and programming at a higher level than that of machine code. |
Forum: Java Feb 21st, 2008 |
| Replies: 16 Views: 6,936 int num = Integer.parseInt(parseString) |
Forum: Java Feb 21st, 2008 |
| Replies: 13 Views: 1,239 thnx guys for your help my work is solved. |
Forum: Java Feb 19th, 2008 |
| Replies: 13 Views: 1,239 Thanks a million guys. I am almost there. I have an out of bounds exception -1 though which I dont understand. this is my code and I have included both my classes.
/**
* Stores the name of an... |
Forum: Java Feb 18th, 2008 |
| Replies: 13 Views: 1,239 I have to do a really strange thing.
I have to take a string of 2 words and then separate it and put it into two other strings eg
String name = "fred blogs";
move the part of the string name... |
Forum: Java Feb 7th, 2008 |
| Replies: 1 Views: 1,628 For the guys who helped on the card.java file I did thnaks a lot I got that done. I have now moved onto the next part of that and have to complete this skeleton file.
this is the spec for this file.... |
Forum: Java Jan 31st, 2008 |
| Replies: 4 Views: 1,965 thanks both of you. Ezzaral you said I couldn't call the getter methods in the Card class. Is that because getter methods can only be called in a main method? |
Forum: Java Jan 31st, 2008 |
| Replies: 4 Views: 1,965 right I am trying to practice with my programming taking my lectures advice and breaking the problem down into steps, then when I code, code a small amount, compile it check it works and then code... |
Forum: Java Dec 1st, 2007 |
| Replies: 9 Views: 1,253 okay I didnt think of that. thnx. I will bare that in mind. |
Forum: Java Dec 1st, 2007 |
| Replies: 9 Views: 1,253 so stupid. I know what help I can get for my homeworks. I dont know who that was who sent that. I always state if its a homework. There is a level of help you can get. So long as I am not plagerising... |
Forum: Java Nov 28th, 2007 |
| Replies: 9 Views: 1,253 I decided to take the other approach with this cus I cant use the scanner class to save my life. So instead I have decided to use substring. My thought it if I separate a string in two then I can... |
Forum: Java Nov 27th, 2007 |
| Replies: 9 Views: 1,253 okay I have made a revision of my code. I know nothing is being outputted in my main class but have I created the new sentence? this one is a real head scratcher for me. |
Forum: Java Nov 27th, 2007 |
| Replies: 9 Views: 1,253 I have been given a homework this is it:
I have chosen to attack this problem using the scanner class. The problem I have is at runtime just the word "word" is printed loads and loads of times... |
Forum: Java Nov 9th, 2007 |
| Replies: 14 Views: 1,761 I finally got it :-D Thanks a lot you really helped.
driver class
class ModuleDriver
{
public static void main(String args[])
{
// shows use of constructor with arguements inName and... |
Forum: Java Nov 6th, 2007 |
| Replies: 14 Views: 1,761 thnx m8. I think I got it now.
This is the final code I have.
driver class
class ModuleDriver
{
public static void main(String args[])
{
Module m1 = new Module();
m1.moduleId... |
Forum: Java Nov 6th, 2007 |
| Replies: 14 Views: 1,761 I wouldnt be excercising all the methods if I define it in the driver and thats the problem I have. The driver has to use all the methods. If I create the strings in the driver class then it doesnt... |
Forum: Java Nov 5th, 2007 |
| Replies: 14 Views: 1,761 okay i didnt know ther were any code tags.
what it is ment to print out is
Module name : Programming 2
Module ID : CG0048
Lecture Room : Pandon S1
Module Tutor : Alan Maughuan
At the... |
Forum: Java Nov 5th, 2007 |
| Replies: 14 Views: 1,761 okay guys thanks for all your help. I have started creating the driver and have become stuck. I cant get it to print out the different pieces of infomation as defined in my strings (in bold).
... |
Forum: Java Nov 5th, 2007 |
| Replies: 14 Views: 1,761 okay guys I found out about the constructors and now have 2 errors to do with my toString command. I highlighted in bold where I got errors. The error said class, interface or enum expected. Also... |
Forum: Java Nov 1st, 2007 |
| Replies: 14 Views: 1,761 this is the homework I have to do
This is the code I have for it at the moment. I keep getting return type required errors. can you help?
class Homeworkone
{
private String... |
Forum: Java Oct 22nd, 2007 |
| Replies: 3 Views: 2,052 wow. you are good at java. I tried the code and what I did was I added lines where you put the questions and was able to add new questions very simply. There are some things in that which I dont... |