ClassComputetoLab317

ClassComputetoLab317 - P = 1; pow = 1.0; btmSum = 1.0;...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.*; import javax.swing.*; import java.text.*; class Sin { private Double sin; private Integer i=1; private Double btmSum, Sin; public void Sin() { sin = 0.0; } public Double getSin(){ return sin; } public void setSin(double X, int N, double sinsum, int P, double pow ){
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: P = 1; pow = 1.0; btmSum = 1.0; while (i<N) { i++; if (P >= 1) { P = 0; btmSum = btmSum * i; sinsum += Math.pow(X,pow)/btmSum; } else { P = 1; btmSum = btmSum * i; sinsum -= Math.pow(X,pow)/btmSum; }; pow += 2; } sin = sinsum; } }...
View Full Document

This note was uploaded on 05/01/2008 for the course ECE 172 taught by Professor Olabe during the Spring '08 term at Christian Brothers.

Page1 / 2

ClassComputetoLab317 - P = 1; pow = 1.0; btmSum = 1.0;...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online