1 Replies - 1992 Views - Last Post: 25 August 2006 - 11:11 PM Rate Topic: -----

#1 slowlearner  Icon User is offline

  • New D.I.C Head

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

Java Assignment!

Post icon  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  Icon User is offline

  • or something bad...real bad.
  • member icon

Reputation: 1256
  • View blog
  • Posts: 4,618
  • 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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1