954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help please

i have java assignment >>


i need any one to help me to solve it >>

this is my e-mail >>> [email removed]
...............................

Java Assignment 3

1.Use nested loops that print the following pattern:-

A) 1
12
123
1234
12345
123456

2.Write a program to compute the sum and product of all odd integers from 1 to 19.


3.write a program which writes the integers from 1 to 50, replacing every multiple of (5) by the word "OK" and every integer divisible by (11) by the word "FINE"
Ex.
1 2 3 4 OK 6 7 8 9 OK FINE 12 13 14 OK….....


4.Write a program that read a list of numbers from the user, storing them in one dimension array, then prints them in the opposites order.
Example
Input :- 5 8 7 1 12 10 78 14 5 32 15
Output:- 15 32 5 14 78 10 12 1 7 8 5


5.Write a program to find the positions and number of zeros in two dimension array of integer.


6.Write a program that reads a student’s test scores in the range of 50-100. It should then determine the number of students having scores in each of the following ranges: 50-59, 60-69, 70-79, 80-89, 90-100.
Note: use one dimension array to store the students score.

zoooz_20
Newbie Poster
11 posts since Jul 2008
Reputation Points: 8
Solved Threads: 0
 

Please read: the forum rules
sticky on homeworks
after that reformulate your question

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

i hava solve the 1st one and the 3rd one but the athor i dont

zoooz_20
Newbie Poster
11 posts since Jul 2008
Reputation Points: 8
Solved Threads: 0
 

for loop from 1 to 19
if statement is num%2 == 1
yes, add to sum
no, next number
problem solved

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

Come on now, show some effort. Show us what you have tried in solving those problems, and provide information about what is going wrong with them and we will help you correct them, but we will not do them for you.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

1.Use nested loops that print the following pattern:-

A) 1
12
123
1234
12345
123456
>>>>>>>>>>>>>>>>>>>>
the answer is :

mport java.util.Scanner;
public class program1 {                              // declaration of class
  public static void main ( String [] args ) {       // declaration of main method
   
    for ( int i = 1 ; i <= 6 ; i++ ) 
    {
      for ( int x = 1 ; x <= i ; x++ )
     {
          System.out.print(x);                       //This statement to print X
      }
      System.out.println();                          // This statement to print a new line
    }
  }                                                  // end of main method
}                                                    // end of class
zoooz_20
Newbie Poster
11 posts since Jul 2008
Reputation Points: 8
Solved Threads: 0
 

3.write a program which writes the integers from 1 to 50, replacing every multiple of (5) by the word "OK" and every integer divisible by (11) by the word "FINE"
Ex.
1 2 3 4 OK 6 7 8 9 OK FINE 12 13 14 OK….....
>>>>>>>>>>>>>>>>>>>>>
the answer is :

import java.util.Scanner;
public class program3 {                              // declaration of class
  public static void main ( String [] args ) {       // declaration of main method
    
    int x ;
    
    for ( x = 1 ;  x <= 50 ;  x++ ) {
      if ( x % 5 == 0 )
        System.out.print( " Ok " );
      else if ( x % 11 == 0 )
        System.out.print( " Fine " );
      else 
        System.out.print( " " + x + " " );
    }
  }
}
zoooz_20
Newbie Poster
11 posts since Jul 2008
Reputation Points: 8
Solved Threads: 0
 

please i need ur help >>> becuse i have to submit the assignment tomorow ... there is no time >> becuse i need to understand them ... please >>> dont forget me

zoooz_20
Newbie Poster
11 posts since Jul 2008
Reputation Points: 8
Solved Threads: 0
 

No one's forgotten you, but it seems as though you have been wasting your time, and us wasting our time to make up for that isn't going to happen.

Show what you have for the other problems and we will help you to correct it, as already said, but we are not going to do it for you.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

why u r not helpfull with me >>
there is an idea in this programs but i dont know what is it ...

zoooz_20
Newbie Poster
11 posts since Jul 2008
Reputation Points: 8
Solved Threads: 0
 

For 2, what are all even numbers divisible by that odd numbers are not?

For 4, loop backwards.

For 5, nested loops.

For 6, a loop and a an array of length 5 for summing, and divide by 10 and minus 5 to index into it.

There, there are the ideas for each of them.

Us doing your homework for you would not help you. You would learn nothing, and so would come back here tommorrow begging for "help" again, because what you need to do tommorrow built on what you did today, but you didn't do anything today (other than cut-n-paste). That's the way it is, if we simply do it for you, so, no, we are not going to do it for you, that does not help you. Those who fail with effort still understand more than those who pass without it.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

thaaaaaaaanx my frind .... i'll do it and i will be back later ...


thaaaaaaaanx for ur advice ....


i'll be back

zoooz_20
Newbie Poster
11 posts since Jul 2008
Reputation Points: 8
Solved Threads: 0
 

If you have solved a problem and you run it and it works then don't post it. Post only those that you are having problems with.

javaAddict
Nearly a Senior Poster
Team Colleague
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
 

hey again >>>


i have solve the second one>>
2. Write a program to compute the sum and product of all odd integers from 1 to 19.

<<<<<<<<<
the answer is :

import java.util.Scanner;
  
  public class program1 {                                                       
    public static void main(String [] args){                                   
     Scanner scan =new Scanner(System.in);
    
        int  sum =0, product=1 ;                                                            
    
    
       for (int x = 1; x <= 19; x++) {
  
             if (x % 2 ==1)
             sum=sum+x;
      }
        
        for (int y = 1; y <= 19; y++) {
  
             if (y % 2 ==1)
             product=product*y;
      }
        
  System.out.println( sum+"       "+ product );  
         
 
    }  
 
}

i dont know if its correct <<<

and the athers i dont understand the real idea >>

but i'll try ....

zoooz_20
Newbie Poster
11 posts since Jul 2008
Reputation Points: 8
Solved Threads: 0
 

Does it compile?
Are there any errors?
Is it doing what you expect to do?

And please start using code tags (without spaces inside square brackets)
[ code=java]
private final String = "For easy readability, always wrap programming code within posts in [ code] (code blocks) and [icode] (inline code) tags.";
[/code]

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

It could help if you try to go over your program and write a pseudocode and then browse over java tutorials to interpret your pseudocode into java codes....

With a little effort you can answer these problems...

try the following links:
http://www.java2s.com/
http://www.roseindia.net/programming-tutorial/Java-Tutorials
http://www.skillbuilders.com/Tutorials-V2/SkillBuilders%20java%20Tutorials.cfm

loken
Light Poster
29 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

With the exception of that second link which has mainly obsolete, and often times simply bad, tutorials/examples/advice. Roseindia is a blight on the Java world. Nearly everytime I see someone use some really bad practice on many forums and tell them not to do that, they often come back and say "But the tutorial I followed showed it this way!". And where did they get that tutorial ---> Roseindia. Nuff said.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
With the exception of that second link which has mainly obsolete, and often times simply bad, tutorials/examples/advice. Roseindia is a blight on the Java world. Nearly everytime I see someone use some really bad practice on many forums and tell them not to do that, they often come back and say "But the tutorial I followed showed it this way!". And where did they get that tutorial ---> Roseindia. Nuff said.

Lol...

The site didn't seem organized to me just at first glance. I'll probably never go there again.

I've probably learned more here than I have alone. Dani for the win (yes I spelled it out) =P

Alex Edwards
Posting Shark
972 posts since Jun 2008
Reputation Points: 392
Solved Threads: 109
 

/facepalm

I now I feel like an uber noob for going to RoseIndia

bloody_ninja
Junior Poster in Training
96 posts since Jul 2008
Reputation Points: 9
Solved Threads: 2
 

Also first link to java2s.com is loose-win situation.
I would not recommend that site to beginner because either they will learn nothing from it as it does not contain any explanation to the code (code there is simple free copy to code from numerous books, some already out of date) or they will just copy&paste without understanding what that thing does.
However I use that site time-to-time, but I think I'm past the learning of for or while loops...

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You