Search:

Type: Posts; User: iCurtisIT

Search: Search took 0.10 seconds.

  1. Replies
    2
    Views
    827

    Only outputting to the Output file once

    Hi,

    I'm currently having a problem with my code... I am trying to output to a file numerous transactions that have took place.



    if (userInput == 1)
    {
    System.out.println("The...
  2. Replies
    7
    Views
    1,759

    Re: Reading a text file + Nested Loop

    Is there a way of doing it without using an Array?
  3. Replies
    7
    Views
    1,759

    Re: Reading a text file + Nested Loop

    Thank you for your advice. I will try all of the things mentioned and get back to you. I thought learning Spanish was hard, Java is something else.
  4. Replies
    7
    Views
    1,759

    Re: Reading a text file + Nested Loop

    Do you mean this?



    Exception in thread "main" java.util.NoSuchElementException
    at java.util.Scanner.throwFor(Unknown Source)
    at java.util.Scanner.next(Unknown Source)
    at...
  5. Replies
    7
    Views
    1,759

    Reading a text file + Nested Loop

    Hello. I have asked other questions about this, but keep running into more things I do not understand.

    The above blocks of text (Each Unit), carries on until Unit 13.
    I have the following code,...
  6. Replies
    10
    Views
    1,237

    Re: Trouble reading a Text File

    When you mention the split() method, would that mean that I am using array's? Is there anyway of reading the data and assigning each value to a variable to do a calculation for each line considering...
  7. Replies
    10
    Views
    1,237

    Re: Trouble reading a Text File

    Thank you Sir. I do appreciate all your help. I will let you know how I get on. Thanks again.
  8. Replies
    10
    Views
    1,237

    Re: Trouble reading a Text File

    Ok. Thank you. I will try this now and get back to you. Thanks again!

    --- Update ---

    OK. I sort of understand the nextLine() method.

    I need to know how to break a line into two so we can...
  9. Replies
    10
    Views
    1,237

    Re: Trouble reading a Text File

    I really don't understand what you are saying. Argh, this is so frustrating.

    EDIT: OK I understand now. You are saying my code is reading it as it comes, not line by line. Why have you said use...
  10. Replies
    10
    Views
    1,237

    Re: Trouble reading a Text File

    My code isn't right. I am not doing it right. I do not know what I am doing. I know how to read lets say 4 different numbers from a text file (5 6 30 500), but what I don't know how to do it read...
  11. Replies
    10
    Views
    1,237

    Trouble reading a Text File

    Hello All.

    I am having trouble reading data from a text file. I want to read a bit of text, store it (to manipulate later), then do this with each block of text.

    Once all the data has been...
  12. Replies
    5
    Views
    2,333

    Re: Reading until a Blank Line. File input.

    Sorry if it does not make sense, I am sort of new to all of this.

    I have to do calculations with the data from the input file. The input file is laid out as:

    Shop A (Shop A)
    NoOfStaff (6)...
  13. Replies
    5
    Views
    2,333

    Re: Reading until a Blank Line. File input.

    while (inFile.hasNextDouble())
    {
    if (inFile.hasNext())
    {
    number_of_staff = inFile.nextDouble();
    hours_worked = inFile.nextDouble();
    pay_rate = inFile.nextDouble();...
  14. Replies
    5
    Views
    2,333

    Reading until a Blank Line. File input.

    Hello, I am wondering if someone can help me with a problem I have.

    I am using the hasNext() method to read from a file. I have multiple parts in the text file.

    Shop A
    NoOfStaff
    HoursWorked...
  15. Re: Multiple System.out.println lines to Dialog box.

    I'm struggling to understand how I put the 7 lines of text (systemout) and the other statements in the same one box. Am I wrong to say if I put JOptionPane for each time I've put System.out, won't it...
  16. Re: Multiple System.out.println lines to Dialog box.

    This is the end of my code. It is for some sort of calculator. The only thing I am struggling with is "outputting it to a dialog box instead of having it output at the bottom of the eclipse screen"....
  17. Multiple System.out.println lines to Dialog box.

    Hey guys.

    I have multiple System.out.println, 7 to be precise. The last 4 are in a if, else if, else statement. How can I put all of this into one dialog box?

    Thanks in advanced.

    Curtis H.
  18. Replies
    2
    Views
    1,052

    Re: I'm new to Java. Help please.

    Thank you. Just had a look and it looks very helpful. Will get stuck in to it all later on this evening! Thanks again.
  19. Replies
    2
    Views
    1,052

    I'm new to Java. Help please.

    Hello :)

    Well I'm new to all this Java stuff. I'm doing it as one of my modules in my degree.

    I have watched various videos and read the odd book, but to be honest none of it makes much sense...
  20. Replies
    4
    Views
    5,297

    Re: User Input (Press Enter)

    Thank you very much. I just tried something similiar but I kept on getting errors. I am new to this so, so may ask a few more very basic questions, hehe.

    Thanks again. Appreciate it.
  21. Replies
    4
    Views
    5,297

    User Input (Press Enter)

    Hey!

    I don't know if this query is in the correct place. If it isn't, sorry, and could someone please move it.

    I am making a Volume calculator as my first piece of coursework and I need the...
  22. Replies
    0
    Views
    876

    Hello everyone

    Hello everyone!

    My name is Curtis, and I have just started a Cyber Security Degree in Liverpool, UK. One of my modules is Computer Programming and I am very new to all of this. During my first...
Results 1 to 22 of 22