Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Simple JAVA program problem?

Hey guys.. So I am a Networking student and took a Java class for giggles and I am sorry for doing so lol... I have a very simple question that I can't write a code for and keep failing. The Question is; "Write a program that prompts the user to enter minutes (e.g, 1 billion) and displays the number of years and days for the minutes. Here is a sample run;

Enter the number of minutes: USER INPUT {ENTER}

USER INPUT minutes is approximately XXX Years and XXX days. "

I am using Netbeans and I just don't know how to go about this. I suck at math and programming as well. Any advice would be helpful :) Thanks!

2 Answers

Relevance
  • 10 years ago
    Favorite Answer

    I would love to help you

    I know many computer languages like

    Ms dos

    Jama

    Pearl

    Extended markup launguage/XML

    HTML

    Vbs

    But am beginning JavaScript I am 13 and am learning these online

    All I remember right now is

    <head>

    <body>

    <lunguage/JavaScript>

    Somthing like that sorry I couldn't help

    Try using languages u would compile much simpler to me

    Source(s): Me And my love for programming
  • Anonymous
    5 years ago

    int[] myArray = {a million,2,3,4,5}; int entire = 0; for(int i=0; i<myArray.length; i++) { entire += myArray[i] * myArray[i]; } equipment.out.println("the finished is: " + entire); ---------------- You did no longer incorporate your source code, yet i've got confidence your subject might desire to be one in each and every of two issues. the two you're reinitializing your variable each and every time you progression throughout the time of the array (something like this): int entire; for(int i=0; i<myArray.length; i++) { entire = 0; entire += myArray[i] * myArray[i]; } ... which might revery entire to 0 each and every time you progression throughout the time of the array. or according to possibility you're no longer which includes the previous entire volume once you advert the recent volume. something like this: for(int i=0; i<myArray.length; i++) { entire = myArray[i] * myArray[i]; } observe that particularly of "+=", I used "=". this could reset entire to myArray[i] * myArray[i] each and every time. via making use of "+=", that's truly doing an identical subject as: entire = entire + myArray[i] * myArray[i]; easily, that's what the pc does internally, so making use of "+=" is merely a shortcut technique of writing the above code. one in each and every of those 2 subject concerns is perhaps your subject. wish that helps!!!

Still have questions? Get your answers by asking now.