Initializexminandmax usingaknownvaluethefirst

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: willberequired todemonstrateyourprogramusingatestfunction providedinclassonthedatedeliveryisdue. Input Process Output a thestartpoint Initializeinput variablesas doublesandint asappropriate Show the initializedinput variables b theendpoint Calculatedx thesizeofeach incrementsuchthatn*dx =b ­ a Showdx n numberof subintervalson [a,b] 1. Initializex,min,andmax usingaknownvalue ­thefirst valueontheinterval. 2. Calculatethevalueofeachx. x=a+i*dx 3. Calculatey foreachx. 4. Ify isgreaterthanmax, updatemax. 5. Ifyislessthanmin,update min. Showmin &max overtheinterval [a,b] Input/Process/Output continued Input Process Calculateascalefactor, Showsf sf,sothatthemax valuewillbeprintable ontheavailablescreen (<80columnsinthe Command prompt screen,<160columns intheEclipseconsole output) Foreach x=a+i*dx Calculate y. Forthisvalueofy graph determinethenumber ofspacestoprint.Print thatmanyspaces.Print Output Scaling m=(70 0)/(max min) Pointslopeformula:y y0 =m(x x0) x0=min,y0 =0, numCols =m(y min) FlowCharting Selection Input Decision in no Yespath Nopath Statements Sequential Oneinput Oneoutput Flowofcontrol Foll...
View Full Document

Ask a homework question - tutors are online