Search:

Type: Posts; User: noblegas

Page 1 of 2 1 2

Search: Search took 0.29 seconds.

  1. Re: java program that prints out taylor series for function e^x

    Thanks that worked. BTW, how did you come up with while(3*x=>counter): Did you use trial and error methods to arrive at your result?
  2. Re: java program that prints out taylor series for function e^x

    when I changed my while(counter>=x) to while(counter>2) the output is now 2.
  3. java program that prints out taylor series for function e^x

    Hi again,

    I am having issues with writing code for the taylor series e^x. here is my code:



    //java program that asks the user to input a number that e^x=1+x+x^2/2! +x^3/3!...

    import...
  4. Re: java program that prints out taylor series for mathematical constant e

    I already fixed it
  5. java program that prints out taylor series for mathematical constant e

    I am trying to write a java program that prints out the number that is the mathematical constant e. As you input a number, the larger it gets , the closer it comes to 2.71828 . Here is my code:

    ...
  6. problem with creating java program that prints the smallest number

    Here is my code :


    import java.util.Scanner;

    public class smallestnumber
    {
    public static void main(String args[])
    {
    Scanner input=new Scanner(System.in);
  7. Problem with program that inputs second largest and largest numbers

    I am having a problem with my code where I asks the user to input two largest numbers. Here is my code


    //java program that asks user to input a number and print the 1st and 2nd largest numbers
    ...
  8. Replies
    3
    Views
    136

    Re: prime number generator

    That is true. Do you think I should just changed the expression i*j!=0 to i*j==0 and print an if statement that skips composite numbers and then add an else if statement that only prints prime...
  9. Replies
    3
    Views
    136

    prime number generator

    public class printprimes2{

    public static void main(String[] args){

    for( int i = 1 ; i <=199 ; i++ ) //iterate 1 - 199; 2 is prime
    {
    for ( int j = 2 ; j < i ; j++ ) //iterate 2...
  10. Re: Java application that displays composite numbers

    So do you think I should reorder the forloops around? Ill try that. I modifiy the code and removed the counter. Now here is the code

    //a java application that prints out composite numbers that...
  11. Re: Java application that displays composite numbers

    I took your suggestion and and started with new slate. Here is my new code with comments

    //a java application that prints out composite numbers that range from 1 to 100

    public class...
  12. Re: Java application that displays composite numbers

    Okay.

    1. A composite number is a number that has factors other than 1 and itself.
    2 declare two integer variables for two for loops
    3. I write a forloop that loops around integer that range from...
  13. Re: Java application that displays composite numbers

    I tried (num%i==0)instead of if(num%i!=0) same integers are displayed. What are your suggestions?
  14. Re: Java application that displays composite numbers

    It isn't supposed to display the number zero, it is supposed to displayed numbers who have no remainders, ie composite numbers , which include all even numbers(accept two) and all odd numbers that...
  15. Re: Java application that displays composite numbers

    Because since this code doesn't have a remainder(the remainder is zero) it should print out composite numbers
  16. Re: Java application that displays composite numbers

    Oh, I forgot to add my comments. Oh well. Well the two for loops is supposed to displayed numbers that ranged from 1 to 100 and including 100. I added the if statement because when the for loop runs...
  17. Java application that displays composite numbers

    Hi,

    I am trying to write a java application that displays composite numbers between 1 and 100. Here is the format of my code:

    //a java application that prints out composite numbers that range...
  18. java application that calculates an exponential function

    There is an error in my code that pops when I tried to execute my java application for an exponent function that I wrote. Here is my code and here is the error is generated when I run my code:

    //a...
  19. Replies
    11
    Views
    363

    Re: pythagorean triples using a for loop

    I used double equal signsand that didn't even work
  20. Replies
    11
    Views
    363

    Re: pythagorean triples using a for loop

    I want to displayed a table of pythagorean triples that until the values reach 500.The code above is supposed to be the equation for the pythagorean theorem and when I attempt to compile it, java...
  21. Replies
    11
    Views
    363

    Re: pythagorean triples using a for loop

    Fixed most of my errors. Now only one error is generated when I attempt to compile the code:


    //a java application that prints the table of pythagorean triples that go up to 500 using a for loop...
  22. Replies
    11
    Views
    363

    pythagorean triples using a for loop

    I have generated many errors in my code for this program but I particularly want to focused on the first error that comes up. Here is the outline of my code:


    //a java application that prints the...
  23. Re: Java application for infinite series that calculates pi

    Nevermind , problem solved
  24. Java application for infinite series that calculates pi

    Hi

    I am having trouble compiling my code for a java application that is supposed to print out the infinite series for Pi. Here is my java code:

    //a java application that generates the infinite...
  25. Re: want to modify code that converts binary code to decimal numbers

    I haven't learned boolean yet. I tried adding a charter string where I said n!='n' to exist out inside the while curly brackets , but that didn't some to work. Couldn't I just incorporate teh while...
Results 1 to 25 of 46
Page 1 of 2 1 2