introduction to object oriented programming 6
A sinusoid or sine wave is a mathematical function of the form
ð‘¦(ð‘¡) = ð´ sin(2ðœ‹ð‘“ð‘¡ + ð‘¡0) + ð‘¦0,
with four parameters:
- ð´ denotes the amplitude of the sine wave (default value: 1).
- ð‘“ denotes the frequency of the sine wave in Hz (default value: 1/2ðœ‹).
- ð‘¡0 denotes the amount of phase (horizontal) shift of the sine wave (default value: 0).
- ð‘¦0 denotes the y-offset or vertical shift of the sine wave (default value: 0).Create a class called Sinusoid with four double data fields representing the four parameters. Additionally, create the following:
- No-argument constructor Sinusoid() that creates a sinusoid with the four default parameter values.
- Constructor Sinusoid(double newAmplitude, double newFreq, double newPhase, double newYOffset) that creates a sinusoid with the user-specified parameter values.
- Method double evalAt(double t) that evaluates the y value of the sinusoid at time t.
- Method double[] evalAt(double[] tArray) that evaluates the y values of the sinusoids at thetimes in array tArray.
- Method void printFunction() that prints the functional form of the sinusoid to the console with2 decimal places for each parameter, e.g. y(t) = 2.00sin(6.28t + 0.50) + 0.10 for the sinusoid with amplitude 2, frequency 1, phase 0.5, and y-offset 0.1.Submit your source code in a file named Sinusoid.java! Do not include a main() method in your submission!
#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper
#Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational
