Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien
logo-home
Programming Practice $11.16
Ajouter au panier

Autre

Programming Practice

 0 fois vendu
  • Cours
  • Établissement
  • Book

These documents will help you learn how to code, assisting you with your course.

Aperçu 1 sur 1  pages

  • 2 mai 2022
  • 1
  • 2021/2022
  • Autre
  • Inconnu
avatar-seller
Unit 1 Programming
Tutorial 5: Software Design V
To be used in week 5, week beginning 8 October 2018.


Following from the previous pseudocode problems, supply code for the follow situation:


The Prime Problem
A prime number is an integer, greater than 1, which has no exact integer factor other than 1 and the number itself.
That is to say, there are no values, which, if you divide the number by them, give a remainder (or modulus) or zero.
Obviously, the only even prime is 2, and then the odd primes start 3, 5, 7, 11, 13, 17, ...
As well as underlying a lot of pure mathematics, they are of great importance in such computational tasks as the
(security-related) enciphering of information. Multiply your data by a prime and you can only recover the original
using the prime; if you start with a non-prime, the factors will allow a multitude of intermediate steps (each will usually
reveal some information, suggesting that this value be kept and used). There is no known limit to the magnitude of
primes, and no way of finding them apart from testing that they have no modulus == 0 factors.
Write an algorithm which takes an integer and states whether or not it is a prime. Note that you only need to test
whether the candidate prime can be exactly divided by other, smaller primes. For example, any factor of 6 must also
be a factor of 2 and 3, and any factor of 9 must also be a factor of 3.
Using stepwise refinement write down a suitable solution to this problem in pseudocode, NOT Java.




1

Les avantages d'acheter des résumés chez Stuvia:

Qualité garantie par les avis des clients

Qualité garantie par les avis des clients

Les clients de Stuvia ont évalués plus de 700 000 résumés. C'est comme ça que vous savez que vous achetez les meilleurs documents.

L’achat facile et rapide

L’achat facile et rapide

Vous pouvez payer rapidement avec iDeal, carte de crédit ou Stuvia-crédit pour les résumés. Il n'y a pas d'adhésion nécessaire.

Focus sur l’essentiel

Focus sur l’essentiel

Vos camarades écrivent eux-mêmes les notes d’étude, c’est pourquoi les documents sont toujours fiables et à jour. Cela garantit que vous arrivez rapidement au coeur du matériel.

Foire aux questions

Qu'est-ce que j'obtiens en achetant ce document ?

Vous obtenez un PDF, disponible immédiatement après votre achat. Le document acheté est accessible à tout moment, n'importe où et indéfiniment via votre profil.

Garantie de remboursement : comment ça marche ?

Notre garantie de satisfaction garantit que vous trouverez toujours un document d'étude qui vous convient. Vous remplissez un formulaire et notre équipe du service client s'occupe du reste.

Auprès de qui est-ce que j'achète ce résumé ?

Stuvia est une place de marché. Alors, vous n'achetez donc pas ce document chez nous, mais auprès du vendeur cdfkmgkjnfjn. Stuvia facilite les paiements au vendeur.

Est-ce que j'aurai un abonnement?

Non, vous n'achetez ce résumé que pour $11.16. Vous n'êtes lié à rien après votre achat.

Peut-on faire confiance à Stuvia ?

4.6 étoiles sur Google & Trustpilot (+1000 avis)

75814 résumés ont été vendus ces 30 derniers jours

Fondée en 2010, la référence pour acheter des résumés depuis déjà 15 ans

Commencez à vendre!

Récemment vu par vous


$11.16
  • (0)
Ajouter au panier
Ajouté