Search:

Type: Posts; User: lordofrandom

Search: Search took 0.08 seconds.

  1. Re: How can I add empty string ("") to the end of textfile

    Oh wow thats a good idea, I'll try that out thanks.
  2. Re: How can I add empty string ("") to the end of textfile

    This is a bit difficult to explain but I am writing a program that allows the user to write to a text file using randomaccessfile. The user enters name, age, and address, and each of these items is...
  3. How can I add empty string ("") to the end of textfile

    I am writing to a RandomAccessFile. When I try to do raf.writeBytes("") the textfile ignores this empty string and just removes it from the file. Is there a way so that the textfile will save this...
  4. Replies
    1
    Views
    1,198

    How do you compare Doubles numerically?

    if you are converting strings to Doubles by using Double.parseDouble(string), how can you compare them numerically ( >, <, ==) with other Doubles? Is there a way to convert Doubles to primitive...
  5. Very frustrating problem with writing to a file, cannot find file when overwriting.

    Hi, I wrote a database program that works perfectly fine on my home computer with Java 1.7. However, when I run the same exact code on my school computer there is a problem with overwriting a text...
  6. Re: File reading from a specific point on a line

    Oh...yeah I completely forgot about String.split. Thanks a lot!
  7. File reading from a specific point on a line

    Hi, I am having some trouble with reading a line at a specific point. For example I have several lines of data similar to this:

    Talsma,Tegan,743448,F,4F1,4K2,S4,950805,9051726485

    I want the...
  8. Replies
    8
    Views
    3,082

    [SOLVED] Re: decimal format not working

    This works

    DecimalFormat df=new DecimalFormat("#.00");
  9. Replies
    8
    Views
    3,082

    [SOLVED] Re: decimal format not working

    I found part of the problem, it doesn't add 2 decimal places if there is only 1 decimal place. 8.5 doesn't turn into 8.50. I just need a way to add a 0 if it has only 1 decimal place
  10. Replies
    8
    Views
    3,082

    [SOLVED] Re: decimal format not working

    This is the output:


    Employee Payroll (Sorted by last name)
    F.Name L.Name Hourly Wage Hours Worked Gross Pay 20% Tax Net Pay
    Paul Allen $21.50 ...
  11. Replies
    8
    Views
    3,082

    [SOLVED] Re: decimal format not working

    Employee Payroll (Sorted by last name)
    F.Name L.Name Hourly Wage Hours Worked Gross Pay 20% Tax Net Pay
    Paul Allen $21.50 34 731.0 ...
  12. Replies
    8
    Views
    3,082

    [SOLVED] decimal format not working

    import java.util.Formatter;
    import java.util.*;
    import java.text.DecimalFormat;

    public class program5c
    {
    static DecimalFormat df=new DecimalFormat("#.##"); ...
  13. Replies
    2
    Views
    1,751

    Re: Sorting 2D Array problem

    Thanks a lot, sir.
  14. Replies
    2
    Views
    1,751

    Sorting 2D Array problem

    Hi, I am using a bubble sort algorithm to sort a 2D array. The array is as follows:



    String data[][] = {{"John", "Smith", "14.75", "30", "ZZZZ", "ZZZZ", "ZZZZ",},{"Bill", "Gates", "18.50",...
  15. Re: Vowel frequency in a string, it compiles but getting error

    Thanks a lot.
  16. Vowel frequency in a string, it compiles but getting error

    import java.util.Scanner;
    public class program4f_4
    {
    public static void main(String args[])
    {
    Scanner sc = new Scanner(System.in);
    System.out.println("Enter a string to...
  17. Replies
    2
    Views
    1,131

    Re: maximum of two numbers method problem

    Oh wow I'm an idiot

    I have to print 'value' not maximum, thanks.
  18. Replies
    2
    Views
    1,131

    maximum of two numbers method problem

    I just got introduced to methods and functions, and I have to use them to find the max of two integers entered by the user. Below is my code and the error I get is "cannot find symbol - variable...
Results 1 to 18 of 18