Вы находитесь на странице: 1из 6

Student Information System

Special Problem in Software Development


Engineering Technology Division
2015
TEAM ROCK
BSCoE-III
`

Engr. Jamie Eduardo C. Rosal


Instructor

EXECUTIVE SUMMARY

Many students really have a hard time classifying if a certain integer is a prime or not. Prime
numbers are defined as numbers whose factors are 1 and itself. This program was created to
lessen the burden of an individual in determining prime numbers especially when big numbers
were already involved. In this program, the user will have the opportunity to declare the range of
data from where it will start and end. A list of prime numbers will be showed after inputting the
desired range. Printing prime numbers will contribute a great help not just to the students but
also to anyone who have a great concern in classifying numbers according to its factors. This will
surely lessen the time spend in classifying numbers at the same time not limiting the range of
data to be inputted. Printing prime numbers maybe just a simple program but it can be a help to
everyone especially students and this program is easy to use. Our prime purpose in life is to help
others even if its just a small thing it could be counted as help. Like this program.

Introduction
Prime numbers are what is left when you have taken all the patterns away. I think prime
numbers are like life. They are very logical but you could never work out the rules, even if you
spent all your time thinking about them.
Mark Haddon, The Curious Incident of the Dog in the Night-Time.
This project namely Printing Prime Number was build because of me and this subject. Printing
Prime Numbers was made because as a student Aim experiencing a hard time specifically in our
discrete mathematics subject, our teacher assign us to find the prime numbers between 1-100 and
find a concrete way to easily identify prime numbers. While in other case our subject know as
programming was giving us our final requirement to develop a program that is connected to
equations, problem solving or simply involveengineering mathmetics. So I connect discrete and
programming why not develop a program that can find prime numbers? so that's the journey
why PPN was made. Printing Prime Numbers it worth doing beacause I was challege to find P
not X or Y but P (Prime Numbers).
This project has simple objectives to know prime numbers and to identify the discrepancy
between prime and composite numbers. It is interesting because it was simply made of codes and
knowledge. Printing Prime Numbers cannot print prime numbers backwardly; FROM NUMBER
must be lower than TO NUMBERS. PPN has no limitation you can find prime numbers even in a
range of 1-1000000.
PPN was successfully made by the knowledge I learned in our CC# 2207, subject Comp220 with
the description of Computer Programming this 3 units subject was my guide and reason why
PPN was made. I can say that my greatest motivation to develop this program is to pass this
subject.

Objectives
To know the prime numbers
To identify the discrepancy between prime and composite numbers
To print prime numbers
To find a easier path in identifying prime numbers

Purpose and description


Identify and print prime numbers.
Printing Prime Numbers can enable you to find prime numbers easily.
PPN is a simple program with the purpose of helping students related in prime numbers.

Scope and limitation


Printing Prime Numbers (PPN) can identify and print prime numbers to a given range.PPN can
print prime numbers from lowest to highest. Also PPN cannot print prime numbers if the FROM
number is bigger than TO numbers it cannot find prime numbers backwardly.PPN has no
limitation you can find the prime numbera in a range of 1-1000000.

Project sample Run

Users Manuals
Run the program by pressing SHIFT + F6

Dialog box will appeared

Click OK

Enter the desired number FROM NUMBER:


Note:
FROM NUMBER must be lower than TO NUMBER

Enter
Enter desired number TO
NUMBER:

ENTER

Wait for the prime numbers to be printed.

Relevant source code


/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lorraine_prime;

import java.util.Scanner;
import javax.swing.JOptionPane;

/**
*

* @author acer
*/
public class Lorraine_Prime {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic hereint gika
int gikan;
int hangtod;

JOptionPane.showMessageDialog(null,"HEY FOLKS");
do{
System.out.println("FROM NUMBER: ");
gikan=new Scanner(System.in).nextInt();
System.out.println("TO NUMBER: ");
hangtod= new Scanner(System.in).nextInt();

if(gikan>hangtod){System.out.println("[FROM NUMBER] must be lower than [TO


NUMBER] ");}
}while(gikan>hangtod);

System.out.println("Prime numbers from " +gikan+ " to "+ hangtod);

for(int number=gikan; number<=hangtod; number++){

if(PRIME(number)){
System.out.println(number);}}
}

public static boolean PRIME(int number){


for(int i=2; i<number; i++){
if(number%i == 0){
return false;}}
return true;}}

Вам также может понравиться