Devoir en java


Précédent   Bladi.net > Catégorie Principale > Aide & Formalités administratives


Réponse
 
Outils de la discussion Modes d'affichage
  #1  
Vieux 13/02/2007, 03h48
NEVER SAY DIE
 
Date d'inscription: mars 2004
Messages: 929
Par défaut Devoir en java

Salut a vous tous,

J'ai un devoir en programmation JAVA que je dois remetter dans 2 jours. Je bosse sur le TP depuis 3 jours mais sans résultats. Est-ce-qu'il y a parmi les bladinautes du Canada des spécialistes en JAVA qui pourront m'aider.
Merci beaucoup.

Voici ci-dessous l'énoncé du TP :

Winter 2007 Assignment 2

Part A - Problem Statement:

A prime number is a number evenly divisible only by itself and the number 1. A composite number has multiple factors.

Write an application that will prompt the user for a number and determine whether or not it is prime. It will output the factors of a composite number.

If the number is prime, it will output a message that states: “x is a prime number.” (Where x is the number inputted by the user.)

If the number is composite, it will output a message that states: “x is not a prime number. Its factors are:” (Where x is the number inputted by the user.) It will then output the factors for the composite number.

Your application must provide a header to tell the user the purpose of the program. It must also ask the user if he / she would like to calculate another.

The output will look like:

Part A - Technical Specifications:

 You will create an application.
 The class name will be PrimeNumbers.
 The program must begin by indicating your name and student number.
 The code must be in line with the programming standards for this course.
 The code must compile.

Part A - Deliverables

 The PrimeNumbers.java file



Part B – Problem Statement:

A year is considered to be a leap year if it is evenly divisible by 4 but not evenly divisible by 100 (unless it is evenly divisible by 400).

Write an application that will prompt the user 5 times for a year and determine whether or not it is a leap year.

The output will look like:



Part B – Technical Specifications:

 You will create an application.
 The class name will be LeapYearApp.
 The program must begin by printing your name and student number.
 The program must output a header indicating the purpose of the program.
 The program must prompt the user to enter a year.
 The program must output the year entered by the user and a message indicating whether or not is it a leap year.
 The code must be in line with the programming standards for this course.
 The code must compile.



Part B - Deliverables

 The LeapYearApp.java file
Réponse avec citation
  #2  
Vieux 13/02/2007, 10h33
Avatar de sat95
j-126
 
Date d'inscription: octobre 2005
Âge: 36
Messages: 5 562
Par défaut Re : Devoir en java

[java] nombre premier [Résolu]

ça pourrait t'inspirer
Réponse avec citation
  #3  
Vieux 13/02/2007, 10h43
Avatar de dannyMan
 
Date d'inscription: janvier 2007
Âge: 32
Messages: 213
Par défaut Re : Devoir en java

Citation:
Envoyé par Mounir8
Salut a vous tous,

J'ai un devoir en programmation JAVA que je dois remetter dans 2 jours. Je bosse sur le TP depuis 3 jours mais sans résultats. Est-ce-qu'il y a parmi les bladinautes du Canada des spécialistes en JAVA qui pourront m'aider.
Merci beaucoup.

Voici ci-dessous l'énoncé du TP :

Winter 2007 Assignment 2

Part A - Problem Statement:

A prime number is a number evenly divisible only by itself and the number 1. A composite number has multiple factors.

Write an application that will prompt the user for a number and determine whether or not it is prime. It will output the factors of a composite number.

If the number is prime, it will output a message that states: “x is a prime number.” (Where x is the number inputted by the user.)

If the number is composite, it will output a message that states: “x is not a prime number. Its factors are:” (Where x is the number inputted by the user.) It will then output the factors for the composite number.

Your application must provide a header to tell the user the purpose of the program. It must also ask the user if he / she would like to calculate another.

The output will look like:

Part A - Technical Specifications:

 You will create an application.
 The class name will be PrimeNumbers.
 The program must begin by indicating your name and student number.
 The code must be in line with the programming standards for this course.
 The code must compile.

Part A - Deliverables

 The PrimeNumbers.java file



Part B – Problem Statement:

A year is considered to be a leap year if it is evenly divisible by 4 but not evenly divisible by 100 (unless it is evenly divisible by 400).

Write an application that will prompt the user 5 times for a year and determine whether or not it is a leap year.

The output will look like:



Part B – Technical Specifications:

 You will create an application.
 The class name will be LeapYearApp.
 The program must begin by printing your name and student number.
 The program must output a header indicating the purpose of the program.
 The program must prompt the user to enter a year.
 The program must output the year entered by the user and a message indicating whether or not is it a leap year.
 The code must be in line with the programming standards for this course.
 The code must compile.



Part B - Deliverables

 The LeapYearApp.java file
bonjour je sais que je suis pas bon en anglais mais je pense que j'ai reussi a comprendre le problem.
je pense que pour ton premier exercice (pour les autres ca va etre a peu pres pareil) je te suggere
1 - de recuperer le nombre entrée par l'utiilisateur de le stocker dans une
variable .
2 - d'utiliser un tableau de chiffre premier (number evenly divisible only by itself and the number 1) (exemple : 2,3,5,7,11,13,17,.....)
3 - debut de la boucle, diviser ta variable d'entrée par chaque nombre du tableau
4- controler le resultat (qui sera stoker dans une autre variable)
5 - si c'est un nombre entier stoker le nombre par lequel tu as divisé dans un autre tableau de sortie , sinon incrementer l'index du tableau de chiffre et aller à 3
6 - une fois que tu auras parcouru tout ton tableau tu pourras afficher les resultats


j'espere que j'etait assez claire , bon courage
Réponse avec citation
Réponse

Outils de la discussion
Modes d'affichage




Fuseau horaire GMT +2. Il est actuellement 15h50.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38