Search:

Type: Posts; User: ColeTrain

Page 1 of 2 1 2

Search: Search took 0.27 seconds.

  1. Re: Why cant I call on the array I returned in the main method?

    In my method addMatrix I return the array result. I then try to call it in my main method to print out, however it gives me an error saying it cannot find the variable. Since I returned it shouldnt I...
  2. Why cant I call on the array I returned in the main method?

    //matrix1
    double[][] matrix1 = {{1, 2, 3},{4, 5, 6},{7, 8, 9}};

    //matrix2
    double[][] matrix2 = {{0, 2, 4},{1, 4.5, 2.2},{1.1, 4.3, 5.2}};

    addMatrix(matrix1,...
  3. Re: How can I sort numbers from highest to lowest and keep names with them? Arrays

    I dont think so... because my sortArray method doesnt work how I thought it would...
  4. Replies
    2
    Views
    1,423

    Re: printing distinct numbers with arrays

    First of all, thanks so much for the reply! Option 2 sounds like what i want to do. Because I do not need the duplicates. However, how would I go about zeroing them out and only printing non-zero...
  5. Re: How can I sort numbers from highest to lowest and keep names with them? Arrays

    Like i said. I cannot use separate classes, they must all be in one. My question is how can I go about sorting them... I don't have a clue how to sort the scores.
  6. Re: How can I sort numbers from highest to lowest and keep names with them? Arrays

    This all has to be in one class. Thanks for the response though!
  7. How can I sort numbers from highest to lowest and keep names with them? Arrays

    I am making a program that asks for how many students and based on that answer a number of boxes come up asking for their name and their score. After it is supposed to sort them from best score to...
  8. Replies
    2
    Views
    1,423

    printing distinct numbers with arrays

    So my code asks a user to enter 10 numbers, it then checks to see if the number is already in the array, then prints out the entered numbers in a dialog box, but does not print duplicates (i.e. if...
  9. Only if one method is true does it call the other?

    Scratch that. I fixed it.
  10. Re: Format Precision Exception? What's going on?

    Thanks! Works perfect now. I figured d stood for double, good to know. I appreciate the fast and informative response!
  11. Format Precision Exception? What's going on?

    public class test {
    public static void main(String[] args) {
    double meter;
    double foot;
    double x = 1;
    double y = 20;


    System.out.println("Feet...
  12. Replies
    2
    Views
    401

    What does '^' do? Is this a boolean?

    I was making a program that told you whether or not the integer you entered was divisible by 5 and 6, 5 or 6, 5 or 6 but not both. The first 2 worked fine with the way I did it and displayed true or...
  13. Replies
    6
    Views
    10,497

    Re: How to make console output bold

    I am programming in NetBeans. The default console output is normal black. All i need is to bold it.
  14. Replies
    0
    Views
    192

    Display Calendars in Console Program

    I am creating a program that prompts the user to enter a year and the first day of the month, Sun=0, Mon=1, etc . . . then shows that years calendar with the correct number date placement, but I am...
  15. Replies
    6
    Views
    10,497

    Re: How to make console output bold

    When I use that format it is actually turning my text gray and not bolding it...



    String bold= "\033[1mJanuary\033[0m";
    System.out.printf("%100s\n", bold);
  16. Replies
    6
    Views
    10,497

    Re: How to make console output bold

    Well the thing is this is for a class I am taking and the teacher wants it bold, yet he didn't teach us how to bold and I can't find it in the book anywhere. Thanks for the help.
  17. Replies
    6
    Views
    10,497

    How to make console output bold

    The program I am creating displays the output into the console and prints out tables. I want the header of these said tables to be bold, how can I do that?

    here is what I want bold:



    ...
  18. Re: Use a boolean to find if a number is divisible

    nevermind, i actually ended up figuring it out.

    Heres what I ended with:



    import java.util.Scanner;

    public class Pg127 {
  19. Re: Use a boolean to find if a number is divisible

    heres what i have so far... dont have the divisibility equation yet.



    import java.util.Scanner;

    public class Pg127 {
    public static void main(String[] args) {

    //Input...
  20. Re: Use a boolean to find if a number is divisible

    well actually it doesnt have to be boolean i realized. I have no idea how to see if a number is divisible by another, so help needed there. But as for the data type i just need one that states true...
  21. Use a boolean to find if a number is divisible

    i am making a program to see if a number is divisible by 5 and/or 6. how do i do this using a boolean? the user inputs and int and then i calculate it and tell them true and/or false. thanks
  22. Re: Can I have an if statement inside a while loop? or something similar?

    what do you mean "something correctly" and "something done wrong"? Could you provide an example please? Thanks for your response
  23. Can I have an if statement inside a while loop? or something similar?

    So i am writing a code to display the windchill temperature, the user enters a temp and windspeed and they are given the windchill temp. The thing is they have to enter a temp within -58F and 41F, I...
  24. Re: Working on a code to calculate interest rates...

    how do i do that?
  25. Re: Working on a code to calculate interest rates...

    Thanks for that. the first 5 months can be displayed in the code, but the 6th is all that is wanted in the dialog box after running the program. I just didnt know if i had to manually put in all the...
Results 1 to 25 of 26
Page 1 of 2 1 2