Search:

Type: Posts; User: etidd

Search: Search took 0.30 seconds.

  1. Re: what happens when you supply the same name of a nonexistent input file?

    What happens when you supply the same name for the input and output files to the LineNumberer program?


    just trying to learn about writing data to files
  2. reading string input then casting it to an int?

    hi, :cool:

    if someone inputs a number in a word (i.e. "two"), how can i take that input and convert it to an int?

    -etidd
  3. what happens when you supply the same name of a nonexistent input file?

    i have a LineNumberer program that i wanna know what happens when i supply the name of a nonexistent input file to this program? does it just throw a FileNotFound exception? :confused:
  4. looping through an ArrayList of objects with their own attributes

    hello again, :cool:

    i am trying to loop through an ArrayList of type object. the objects have their own attributes and i'm trying to call a specific method that accesses a specific attribute. in...
  5. using the setSize and setLocation methods of Rectangle class

    hi everyone. how are you?

    i have a class square that inherits the rectangle class. what i have is center coordinates of the center of a square. i have figured the arithmetic to getting the coords...
  6. [SOLVED] Re: theory behind testing each element of an array.

    i already figured it out. thanks though.
  7. [SOLVED] theory behind testing each element of an array.

    Given an array of ints, return true if the array contains a 2 next to a 2 somewhere.

    has22({1, 2, 2}) → true
    has22({1, 2, 1, 2}) → false
    has22({2, 1, 2}) → false

    public boolean has22(int[]...
  8. Replies
    2
    Views
    522

    can't figure out how to sort an array.

    help! i can't figure out to sort an array. :confused: i think you're supposed to do it like this:


    public int centeredAverage(int[] nums)
    {
    sort([nums.length - 2] sortedList);
    int sum...
  9. [SOLVED] String class: using the substring method to obtain only the last character in the str

    Given a string, return a new string where the first and last chars have been exchanged.

    frontBack("code") → "eodc"
    frontBack("a") → "a"
    frontBack("ab") → "ba"


    public String frontBack(String...
  10. "illegal modifier for parameter sum; only final is permitted

    public class AddTenIntegers
    {
    public static void main (String[] args)
    {
    private int sum; ILLEGAL MODIFIER FOR PARAMETER SUM; ONLY FINAL IS PERMITTED
    private int i; ILLEGAL MODIFIER FOR...
  11. [SOLVED] Re: why does this code print 0.0 for the value and "F" as the letter grade?

    thank you so much!!! \m/\m/\m/
  12. [SOLVED] why does this code print 0.0 for the value and "F" as the letter grade?

    why is it that when i run this it outputs "0.0" and "F" every time?


    import java.util.Scanner;

    public class GradeTest
    {
    public static void main (String[] args)
    {
    Scanner in = new...
  13. Replies
    2
    Views
    1,942

    setting the compiler for eclipse mac os x

    is it soylatte that you download for a jdk package for mac? what do i do to get the compiler set on eclipse?
  14. Re: help with the logic on this letter grade program.

    my idea was to have a couple of local double variables with a constructor public Grade(double value) that constructor's parameter is what receives the user input from the tester class. then, i would...
  15. help with the logic on this letter grade program.

    hey,

    help me think of a good way to get after the logic of this program:
    :confused:
    ---------------------
    Write a program that translates a number into the closest letter grade. For example,...
  16. Replies
    1
    Views
    823

    Card and CardTest

    hi i have a logic error with my program. it returns and prints unknown for every value. have a look...
    what should i even put in the constructor?


    public class Card
    {
    public Card()
    {
    ...
  17. Replies
    2
    Views
    721

    Re: my programs- Card and CardTest

    okay, i got it. the last thing is a logic error with the program. i don't know what to put inside the constructor... does it just allow me to make an object in the CardTest class?
  18. Replies
    2
    Views
    1,288

    Re: another question..

    okay, i seem to have gotten it... there's only one other issue with the logic of my program.
  19. Replies
    2
    Views
    1,288

    another question..

    can someone take a look at the api for the String class and tell me what methods are good for doing a do- while loop to make sure the user put in more than nothing for the program to continue.

    ...
  20. Replies
    2
    Views
    721

    my programs- Card and CardTest

    hi,

    i'm writing a program called Card and its tester, CardTest. i find it very difficult to handle the input from the user in between these two programs.

    CardTest reads in a card value in such...
  21. Re: hi. i want to rewrite this do loop into a while loop.

    yep, sure got it... figured it out myself shortly after posting this. it's great to voice it out to figure it out!
  22. hi. i want to rewrite this do loop into a while loop.

    hi help me rewrite the following do loop into a while loop.


    int n = 1;
    double x = 0;
    double s ;
    do
    {
    s = 1.0 / (n * n);
    x = x + s;
  23. Thread: cosine in java

    by etidd
    Replies
    4
    Views
    13,303

    cosine in java

    how do i implement the cosine trig function in java?
  24. CashRegister class- adding a method getItemCount

    hello everyone,

    new person here. i'm a college student working on my programming homework. i have a class CashRegister that reads the payment in and calculates change due. i have to add a new...
Results 1 to 24 of 24