This preview shows page 1. Sign up to view the full content.
CSE 110 Laboratory Assignment 8
This assignment is due by 11:59 PM on Sunday, November 7. Submit your .java fle through Blackboard
— be sure to submit through the link that corresponds to your lab day and time.
Lab Description
In this week
ʼ
s lab, you will need to develop your own algorithm For a short Java program. This program
requires you to use loops and
if
statements. Start by thinking careFully about the problem that is
described below. You may fnd it helpFul to start by writing some pseudocode or drawing a simple
±owchart on a piece oF paper beFore you start to write any code. You may also fnd it helpFul to work
incrementally: write some code to perForm one (simple) task, then expand it to perForm a second task, and
so on, testing as you go.
A positive integer is called a
perfect number
iF it is equal to the sum oF all oF its positive divisors,
excluding itself
. ²or example, 6 is the frst perFect number because 6 = 3 + 2 + 1. The second perFect
number is 28 = 14 + 7 + 4 + 2 + 1.
Write a small Java program From scratch that reads in a positive integer
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 12/06/2011 for the course CSE 110 taught by Professor Shaunakpawagi during the Fall '08 term at SUNY Stony Brook.
 Fall '08
 SHAUNAKPAWAGI

Click to edit the document details