# Java Assignment!

Page 1 of 1

## 1 Replies - 2115 Views - Last Post: 25 August 2006 - 11:11 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=18095&amp;s=276c71cc58db531a13898e29c9e67e0a&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 slowlearner

Reputation: 0
• Posts: 2
• Joined: 25-August 06

# Java Assignment!

Posted 25 August 2006 - 10:32 PM

Hi! My name is Aqela and I'm new here. I wanted to ask if anyone know how to solve this 2 questions. I'm not sure how to do and it's for my assignment. Thanks!
Here the questions:

As you may have figured out by now, there are two kinds of flow-control operators: a branching operator (if, switch) and a looping operator (for, while). With these operators, it is possible to do a lot of work without doing a lot of coding.

1) Write code to find all of the prime numbers between 2 and 100. A prime number is a number that is evenly divisible only by itself and 1. The number 10 is not a prime because it is evenly divisible by 2 and 5.

2) Write code to find average of all of the numbers in the scores array. Also, using the names array, print out the names of all of students whose score is 70 or above. Assume that student’s name has the same index score.

```double score [] = {50, 100, 75, 81, 90.5, 66, 33, 99};
String names [] = {“Daud”, “Mary”, “Johan”, “Nani”, “Susan”, “Eliza”, “Tomy”,  “Nick”};
```

Is This A Good Question/Topic? 0

## Replies To: Java Assignment!

### #2 dorknexus

Reputation: 1267
• Posts: 4,622
• Joined: 02-May 04

## Re: Java Assignment!

Posted 25 August 2006 - 11:11 PM

Moved to the appropriate forum. also please make sure that you read the forum rules, as it requires that you post your code before we can provide any.