Search:

Type: Posts; User: ///M Dood

Page 1 of 2 1 2

Search: Search took 0.22 seconds.

  1. Replies
    6
    Views
    244

    Re: Beginning java

    If you haven't checked out thenewboston on youtube he's a pretty good way to introduce yourself to java.
  2. Re: Using the ? operator inside of a for loop

    Nevermind, i got all of it...

    Last thing I'd like assistance with if anybody is willing is with my print statement. I am supposed to print my variable i (years) vertically, followed by the values...
  3. Re: Using the ? operator inside of a for loop

    OK, so i figured out what was funky inside of the for loop.


    class Weather
    {
    public static void main(String[] args)
    {
    // declare variables
    int i = 1; // represents year
    double temp...
  4. Re: Using the ? operator inside of a for loop

    hhrrmm... OK, I'll try to make some changes, thanks for the input.
  5. Re: Using the ? operator inside of a for loop

    The type cast of temp is desired, the 0 at the is not however.
  6. Re: Using the ? operator inside of a for loop

    So 1 - 12, then my variable i (year), my year variable (i) and a mysterious 0, repeat?
  7. Re: Using the ? operator inside of a for loop

    Sorry, i just thought you might want to see the little chunk that i altered. Here ya go:


    class Weather
    {
    public static void main(String[] args)
    {
    // declare variables
    int i = 1; //...
  8. Re: Using the ? operator inside of a for loop

    Welp, I have my years variable in the while loop if "(i > 5) break;" , that one seems to be taken care of. Next, i need to display the values of my "temp" value, 12 times per 4 total lines, which...
  9. Using the ? operator inside of a for loop

    Code then description of problems:


    class Weather
    {
    public static void main(String[] args)
    {
    // declare variables
    int i = 1; // represents year
    double temp = 0.0;
  10. Re: Casting from a whole number to a percent

    Wow, i just got that first try. Thank you! Code below for reference. You da man Greg


    class Retirement
    {
    public static void main(String[] args)
    {
    int age = 30;
    double salary = 30000.0;...
  11. Casting from a whole number to a percent

    Hi,

    I had a question about data type casting. Is it possible to take an integer of say 25, and convert that into being a percent so 0.25? How would that look? Where could i go to kind of grasp...
  12. Replies
    11
    Views
    210

    [SOLVED] Re: Continue and break statements

    Here's what i got to work:



    public class Test
    {
    public static void main(String[] args) {
    int i = 1;

    while(true)
  13. Replies
    11
    Views
    210

    [SOLVED] Re: Continue and break statements

    Yes, prior instructions stated that i be initialized to 1. I'm just leaving it for the moment, the whole rest of the assignment is a freaking mess as well.
  14. Replies
    11
    Views
    210

    [SOLVED] Re: Continue and break statements

    OK, i'm really close i think. I got the code to compile and display the desired output, only problem is that in the assignment it requires me to declare a variable of type int, name it i and set it...
  15. Replies
    11
    Views
    210

    [SOLVED] Re: Continue and break statements

    OK, I'll give understanding your post a solid effort before i report back. Just scratching my head how a while(true) statement would be formatted without the if-else statements. I am still quite new,...
  16. Replies
    11
    Views
    210

    [SOLVED] Re: Continue and break statements

    Well, after the println, it's what worked in the final while(true) loop. I tried rearranging everything in the loop like this:


    while(true)
    {
    System.out.println(i);
    if (i > 5) break;
    else...
  17. Replies
    11
    Views
    210

    [SOLVED] Re: Continue and break statements

    "Using a while(true) statement, loop over Year i from 1 through 5, EXCEPT i = 3. Use a break statement to exit the loop as appropriate. When i = 3, it should skip the calculations and go the next...
  18. Replies
    11
    Views
    210

    [SOLVED] Continue and break statements

    Code then description of problem:


    class Weather
    {
    public static void main(String[] args)
    {
    // declare variables
    int i = 1; // represents year
    double temp = 0.0;
  19. Re: hello world script. probably really basic help

    In a class called tuna too i believe :/ Bucky is funny. A mixture of his tutorials and a few other sites isn't a bad route to take.
  20. Replies
    3
    Views
    177

    Re: Whats wrong with this code?????

    Welcome to the forums! Please read the info here: Announcements - What's Wrong With My Code?

    What are you trying to do with your code? you seem to be missing quite a bit.
  21. Replies
    16
    Views
    267

    [SOLVED] Re: Casting int and doubles variables

    I tried that (kind of). Where i got confused is for this (int)((gdpPerCapita - gdpPerCapitaDollars) * 100); i totallyspaced on the whole order of operation thing. The whole math expression inside of...
  22. Re: hello world script. probably really basic help

    As someone who started out using eclipse then went to compiling and running codes through the terminal/command prompt i would recommend not starting out with an IDE. But this is coming from someone...
  23. Replies
    16
    Views
    267

    [SOLVED] Re: Casting int and doubles variables

    YOU ARE AMAZING thank you so much! I tried variations of that for hours upon hours. You don't even understand. The one thing i never did try was putting the * 100 into parenthesis. Jeez,...
  24. Replies
    16
    Views
    267

    [SOLVED] Re: Casting int and doubles variables

    Bump, can anyone show where i am being stupid? Just don't say everywhere :)
  25. Replies
    16
    Views
    267

    [SOLVED] Re: Casting int and doubles variables

    Right, so, this then right???

    int gdpPerCapitaCents = (gdpPerCapita - gdpPerCapitaDollars) * 100;


    That is saying (43.75 - 43) x 100.

    I get what you are saying, and i know spoon feeding...
Results 1 to 25 of 50
Page 1 of 2 1 2