100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada
logo-home
Programming Practice 10,20 €
Añadir al carrito

Otro

Programming Practice

 0 veces vendidas
  • Grado
  • Institución
  • Book

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

Vista previa 1 fuera de 1  páginas

  • 2 de mayo de 2022
  • 1
  • 2021/2022
  • Otro
  • Desconocido
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

Los beneficios de comprar resúmenes en Stuvia estan en línea:

Garantiza la calidad de los comentarios

Garantiza la calidad de los comentarios

Compradores de Stuvia evaluaron más de 700.000 resúmenes. Así estas seguro que compras los mejores documentos!

Compra fácil y rápido

Compra fácil y rápido

Puedes pagar rápidamente y en una vez con iDeal, tarjeta de crédito o con tu crédito de Stuvia. Sin tener que hacerte miembro.

Enfócate en lo más importante

Enfócate en lo más importante

Tus compañeros escriben los resúmenes. Por eso tienes la seguridad que tienes un resumen actual y confiable. Así llegas a la conclusión rapidamente!

Preguntas frecuentes

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

100% de satisfacción garantizada: ¿Cómo funciona?

Nuestra garantía de satisfacción le asegura que siempre encontrará un documento de estudio a tu medida. Tu rellenas un formulario y nuestro equipo de atención al cliente se encarga del resto.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller cdfkmgkjnfjn. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for 10,20 €. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

45,681 summaries were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 15 years now

Empieza a vender

Vistos recientemente


10,20 €
  • (0)
Añadir al carrito
Añadido