Can anybody explain me why javapenguin ws banned?
Type: Posts; User: Daler
Can anybody explain me why javapenguin ws banned?
Thank you for help javapenguin and Norm! I really appreciate it... I learn a lot from both of you guys.
That's awesome, look at the output:
[java=code]
Enter how many random numbers you want to generate
100
0. ***********
1. *************
2. ********
3. ****
4. *********
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...
Yes! I changed it to
int freq = (int) (Math.random() * 10);
import java.util.*;
public class xyz
{
//Don't you mind to show me how to fix this?
//the last line was just a comment
Norm,
int [] freq = (int) (Math.random() * 10); // cannot convert from int[] to int
this is the only mistake.. is it possible to fix this??
import java.util.*;
public class xyz
{
public static void main(String [] args)
{
Scanner S=new Scanner(System.in);
System.out.println("Enter how...
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"...
Alright! Here is my code:
import java.util.*;
public class Shapes
{
public static void main(String [] args)
{
Scanner S=new Scanner(System.in);
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...
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);
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;...
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...
what about double num = Math,random(); do I have to use it before loop?
but what about double num = Math,random() ? Where do I have to use it?
Am I right using "while" instead of "for"? Sorry, I am just new to programming...
So I have to use if-else ?
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??
Alright. I know how to do random numbers, but I don't get how to turn them into stars like in the output above... and if you write 100, it will show you 100 stars.. I really don't have an idea what...
I just don't know where to start, and what to do now, if you have some suggestions please help me out :)
Here is a problem:
Write a program that prints a chart to the screen showing the...