Search:

Type: Posts; User: Daler

Page 1 of 2 1 2

Search: Search took 0.18 seconds.

  1. Replies
    3
    Views
    1,028

    Re: Test Question(Introduction Course)

    So I should use String instead of chars, right??

    --- Update ---

    I have changed my code and it shows the right answer, but the output shows like a few Errors before the answer:

    Error
    Error...
  2. Replies
    3
    Views
    1,028

    Test Question(Introduction Course)

    Hey guys,

    Here is the question: Design Java code to find and return the frequency of string b in string a.

    For example , if string a = "abcdabcfabxyabd" and string b = "ab"
    The frequency...
  3. Replies
    4
    Views
    1,163

    [SOLVED] Re: Can't find mistake in my code

    Thanks for very clear algorithm. The answer is correct when I don't put factorial "!" into my calculator(18.07950938), but when I put "!" in the calculator it gives me a different answer with the...
  4. Replies
    4
    Views
    1,163

    [SOLVED] Re: Can't find mistake in my code

    Yes, sir. I've tried it too, but it doesn't give the right answer either. I can't quite understand whether I should add something else to it.
    Sorry.
  5. Replies
    4
    Views
    1,163

    [SOLVED] Can't find mistake in my code

    Hey guys,

    I have a little problem here. The program runs and everything is fine except the actual result. The question is:

    Design Java code to calculate and print ∑ (n! + 5) / (n+1)! ; n is an...
  6. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    Can anybody explain me why javapenguin ws banned?
  7. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    Thank you for help javapenguin and Norm! I really appreciate it... I learn a lot from both of you guys.
  8. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    That's awesome, look at the output:

    [java=code]
    Enter how many random numbers you want to generate
    100
    0. ***********
    1. *************
    2. ********
    3. ****
    4. *********
  9. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    Now I don't see any mistakes, except after I enter the numbers

    [java=code]freq [k]++; // it shows mistake here[/code]

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -5...
  10. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    Yes! I changed it to


    int freq = (int) (Math.random() * 10);



    import java.util.*;
    public class xyz
    {
  11. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    //Don't you mind to show me how to fix this?
    //the last line was just a comment
  12. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    Norm,

    int [] freq = (int) (Math.random() * 10); // cannot convert from int[] to int

    this is the only mistake.. is it possible to fix this??
  13. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    import java.util.*;
    public class xyz
    {
    public static void main(String [] args)
    {
    Scanner S=new Scanner(System.in);
    System.out.println("Enter how...
  14. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    It doesn't show any mistake before I launch it, but after I've entered the number I wanted to generate, it showed me this mistake


    Exception in thread "main"...
  15. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    Alright! Here is my code:



    import java.util.*;
    public class Shapes
    {
    public static void main(String [] args)
    {
    Scanner S=new Scanner(System.in);
  16. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    What does this mistake mean:

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException… -3
    at pratice.main(pratice.java:16)

    it should work now.. I don't know why it does appear that...
  17. Replies
    10
    Views
    3,440

    Re: Please, find my mistake

    Thanks a lot for your help! I have already written the program and it actually worked.. I used the DecimalFormat class as you said before!

    Thanks a lot! I really appreciate it...

    So how to make...
  18. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    so if I will use arrays, it should look like this?

    import java.util.Scanner;
    public class shapes
    {

    public static void main (String [] args)
    {

    Scanner scan = new Scanner(System.in);
  19. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    I am not really sure about arrays. We didn't cover the topics about arrays though. Can you tell me more about it?
    In the first loop we just put like

    for(double num= Math.random(); num <= 10;...
  20. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    Ok! I will try, but if I am wrong, sorry...

    1. Understand what the program is supposed to do. ( I understand, but not so clearly as I should)
    2. Initialize and declare the variables(I should...
  21. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    what about double num = Math,random(); do I have to use it before loop?
  22. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    but what about double num = Math,random() ? Where do I have to use it?
  23. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    Am I right using "while" instead of "for"? Sorry, I am just new to programming...
  24. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    So I have to use if-else ?
  25. Replies
    47
    Views
    4,811

    Re: Guys, really need your help

    I got it, but for example if you wrote 100 as an input, how do the program knows how many *s are needed? How to make *s instead of just random numbers??
Results 1 to 25 of 34
Page 1 of 2 1 2