Search:

Type: Posts; User: Spanky_10

Page 1 of 2 1 2

Search: Search took 0.10 seconds.

  1. Replies
    2
    Views
    1,387

    Inheritence and Polymorphism

    I am to create a program that works as follows:
    1. Write a java class (Employee.java) that encapsulates an employees first name, last name, SSN. Implement the apporpriate get and set methods along...
  2. Re: Two-dimensional Array representing playing cards

    I know how to use classes and objects but I am not good with the arrays. I am not sure how to assign the suit for the first dimension because I also had to create a single dimensional array for the...
  3. Two-dimensional Array representing playing cards

    My two-dimensional array is:
    String[][] cards

    The first dimension is to represent the suit and the second dimension will represent the type of card(from ace to King)

    I want the constructor to...
  4. Replies
    3
    Views
    1,395

    Re: Reading into an ArrayList from a text file

    Pass is what I believe is being added to the ArrayList, which is defined in the default constructor. So it is not in the same scope but I do not know how to bring them out of that ArrayList to read...
  5. Replies
    3
    Views
    1,395

    Reading into an ArrayList from a text file

    I am trying to take a text file and read it into the ArrayList I created. It should store the passengers name and the passenger's service class.

    The text file has the following format:
    James ...
  6. Replies
    1
    Views
    1,965

    Reading from a text file into an ArrayList

    For the following problem, I have created the passenger class and have created the ArrayList in the Train Class. I do not know how to read the passengers from a text file into the ArrayList. And I...
  7. Re: Returning an array of indexes in my program.

    This is what I compiled


    public double[][] get_less_tax()
    {
    double leastTax = rates[0][0];
    double[][] array1 = new double[rates.length][];
    for(int x = 0; x <...
  8. Re: Returning an array of indexes in my program.

    I want to use a for loop to check if the number stored in each part of the array is less than .001



    for(int x = 0; x < rates.length; x++)
    {
    for (int i = 0; i <...
  9. Returning an array of indexes in my program.

    I have a program that creates a double array for 50 states storing the last 10 tax rates for each year. The tax rate is less than .06 in all of them and is randomly configured to make the program run...
  10. Replies
    3
    Views
    1,044

    Re: User defined classes and loops

    I added the print out statement after the while statement and it did print what I input into choice onto the display. It just won't run the program again.
  11. Replies
    3
    Views
    1,044

    User defined classes and loops

    My code all works fine and I have a user defined class called Circle. When I type "y" or "Y" it will not re run the program.



    import java.util.Scanner;
    public class CircleTest
    {
    public...
  12. Replies
    7
    Views
    1,395

    Re: Can't compile program!

    Thank you! I finally got it! You can tell I'm definitely new to this
  13. Replies
    7
    Views
    1,395

    Re: Can't compile program!

    I added an array to my code and thought I did it correct but I get an error saying " cannot find symbol -- myIntArray"



    import java.util.Scanner;

    public class EnglishCalculator
    {
    ...
  14. Replies
    7
    Views
    1,395

    Re: Can't compile program!

    I have the whole code better written now and the only thing I cannot figure out is how to change the num1 and num2 to strings that actually print out the digits in words.
    Output should be "nine"...
  15. Replies
    7
    Views
    1,395

    Can't compile program!

    import java.util.*;

    public class StudentInformation
    {
    public static void main (String [] args)
    {
    Scanner scan = new Scanner (System.in);

    ...
  16. Replies
    5
    Views
    1,512

    Changing digits to words

    import java.util.*;

    public class StudentInformation
    {
    public static void main (String [] args)
    {
    Scanner scan = new Scanner (System.in);

    ...
  17. Replies
    5
    Views
    1,512

    How to convert a digit to words

    I am trying to figure out how to convert digits from 0 to 9 to words in my program.
    What is the proper code to do this?

    I have found examples online but none of them are working with my code. ...
  18. Replies
    10
    Views
    3,297

    Re: Implementing the switch statement

    so completely take out the string = x; and delete the switch (x) but replace it with just int?
  19. Replies
    10
    Views
    3,297

    Re: Implementing the switch statement

    public class StudentInformation
    {
    public static void main (String [] args)
    {
    String x;
    for (int n = 12; n >= 1; n--)
    {
    System.out.println ("On the "...
  20. Replies
    10
    Views
    3,297

    Re: Implementing the switch statement

    So the switch statement without a break will print 3 when i call it and then it will also print 2 and 1 after it or do I need to print them backwards so 12 is the first case and 1 is the last case...
  21. Replies
    10
    Views
    3,297

    Re: Implementing the switch statement

    i did look at that but I don't understand how I can print the first line, then the second line but changing it to "2nd day" and reprinting the first line.
  22. Replies
    10
    Views
    3,297

    Implementing the switch statement

    This is the problem I have to do for a lab. I am not asking anyone to do the work for me but if they could just start it because I have no idea and my textbook doesn't help me very much with this...
  23. Help fixing my Java program! Reading files

    import java.io.File;
    import java.io.IOException;
    import java.util.Scanner;
    import java.text.DecimalFormat;

    public class EchoFileData
    {
    public static void main(String [] args) throws...
  24. Re: Trying to input a text file but the program won't read it.

    Thank You so much! I finally figured it out!
  25. Re: Trying to input a text file but the program won't read it.

    I'm not sure how to do that. It is a download file that I downloaded for an assignment. That is where the text file is located. I tried moving it to my computer, but I'm not exactly sure where to...
Results 1 to 25 of 29
Page 1 of 2 1 2