Search:

Type: Posts; User: CruelCoin

Search: Search took 0.15 seconds.

  1. Replies
    4
    Views
    1,519

    Re: (Java) Overwrite line in .txt file

    Hi,

    Am i correct then in saying that using Filewriter with the same filename will overwrite the existing file? Or would it append?

    CC.
  2. Replies
    4
    Views
    1,519

    (Java) Overwrite line in .txt file

    Hi All.

    I'm trying to create a counter that will survive the program being closed and reopened.

    I need to start with a txt file that has one line in it with 2000 as the text

    On running the...
  3. Replies
    3
    Views
    1,022

    Re: Suggest me an addon?

    Wolfram is a computational engine.

    Lecturer gave us a wolfram api and we are building a Java program around it, in the form of points 1-6 i list in my OP.

    1: Prompt user for question and send...
  4. Replies
    3
    Views
    1,022

    Suggest me an addon?

    Good morning all.

    For my main assignment for Java we are working on a program using WolframAlpha.

    I would love to hear some suggestions as to what i could do for extra functionality.
    The...
  5. Replies
    2
    Views
    1,318

    Re: Create 100 integers?

    That helped, solved and working.

    Thank you sir.
  6. Replies
    2
    Views
    1,318

    Create 100 integers?

    Hi all.

    This program is meant to do the following:

    1: create a new txt file
    2: write 100 random integers to it
    3: read it back into an array
    4: sort the array
    5: print contents of array
  7. Replies
    5
    Views
    1,163

    Re: scanner issues

    Hi All.

    Fixed this.

    Change this:
    while (input.hasNextLine())
    {
    String line = input.nextLine();

    to this:
  8. Replies
    5
    Views
    1,163

    Re: scanner issues

    Hi.

    At line 38 is this: assistantTotal += input.nextDouble();
    This is in the IF block.

    Just for info, the file is comprised of many lines of the following format.

    FirstName1 LastName1...
  9. Replies
    3
    Views
    1,153

    Re: working with decimal point numbers

    You can use math.round to round to 1.0
  10. Replies
    5
    Views
    1,163

    scanner issues

    Hi All,

    Having some difficulties with this section.

    The program runs but is giving me some errors.

    Not sure on how to fix these.
    Any guidance would be greatly appreciated.

    My code:
  11. Replies
    1
    Views
    1,147

    input.next and taking ints and doubles

    Hi all,

    I am writing a program (weekly assignment) that takes numbers from a text file called Q2.txt, ignores white space, and gives the user a printout of the sum total and average of all the...
  12. Replies
    1
    Views
    884

    Invert an integer Triangle?

    Hi all,

    I'm finding it difficult to get my head around the concept, but i managed to construct this for a section of my weekly assignment.


    class Q4d
    {
    public static void main (String []...
  13. Replies
    2
    Views
    1,538

    Integer pyramid 1-15

    Hi all.

    Am almost there with the problem below.

    I need to print an integer pyramid between 1 and 15, but when i get above 10 (11 to 15) i have a spacing problem and not sure how to fix this.
    ...
  14. Replies
    1
    Views
    949

    Can't get 2 different randoms

    Hi all.

    Making a simple maths game that takes a user input as an answer for the sum of two randomly generated numbers.

    Each time i run it, i get 7+7, 2+2, 3+3 etc, but never two different...
  15. Replies
    1
    Views
    1,117

    Loan repayment calculator

    Hi all.

    I'm having some trouble with a Loan repayment Calculator.

    It seems to be working fine, but it give me answers very different to that of online calculators.

    Any tips greatly...
  16. Re: Difference in time with alternative methods

    Thanks! i have posted that convention link to my student group.

    Cheers,

    CC.
  17. Re: Difference in time with alternative methods

    Thanks all.

    1: The only reason i set a class with a number is that is what is being asked of me by my lecturer. e.g: questions 1-9, name the programs and classes within as q1 q2 q3 etc.
    2: Why is...
  18. Difference in time with alternative methods

    Hi all,

    I'm not looking for the answer but rather a point in the right direction would be most welcome.

    I have used two methods to tell the current time from System.currentTimeMillis()

    The...
  19. Replies
    4
    Views
    1,101

    Re: Calculating pi

    Only on our second lecture thus far. Not reached that point yet.
  20. Replies
    4
    Views
    1,101

    Calculating pi

    Hi All,

    having some trouble with calculating pi from the below.

    Instaed of reading 3.14xxx it's giving me 3.28xxx instead. Not sure where i'm going wrong on the maths.

    double pi =...
  21. Replies
    3
    Views
    852

    Re: User input trouble

    Hi,

    Thanks for that. Problem(s) solved.

    I'm still getting to grip with how sensitive code is.

    Cheers,

    CC.
  22. Replies
    3
    Views
    852

    User input trouble

    Hi all,

    First time poster from Ireland here.

    Anything i know from programming is based off a very quick dip into codeacademy and the first lecture given thus far.

    Below is my code for taking...
Results 1 to 22 of 23