Answered step by step
Verified Expert Solution
Question
1 Approved Answer
could you please complete 2.3 for me so i can compare it to my code, thanks in advance! the starting template can be found here:
could you please complete 2.3 for me so i can compare it to my code, thanks in advance!
the starting template can be found here: http://www.site.uottawa.ca/~gvj/Courses/ITI1121/lectures/labs/lab5-2019.html
Lab 5 ITI 112 1 A C I troduct ITI 112 1 Labor y S (2013 search Textbook Solutions Che G Read All Or The Follow na lnstr X x c Best Online Java Viewer Beaut C Not secure www.site.uottawa.ca/ gvi/Courses/T1121/lectures/labs/latb5-2019.htm a @ @@ Second Part Learning Objectives . Create and Implement an Intertace Create an abstract class .Further understanding ot inheritance Abstract classes and interfaces In mahernalics, series is an infinite sequence of ler ris ddded together. The partial sum of the series Is the sum of the first Te terms Here, you must create a class hierarchy, as illustrated by the UMI dlagrambelow, such that all the series have a method next, which returns the next SThe first call to the methad next returrs Si-which is he next call to the methad next returns S2, which is a11a the next call to the methad next returns Ss, which is and sa on. Their er en ation called Arithmetic and Geometric he method next is specific to tie ype a series, here rithmetic and Geometric pech ically, this hierarchycons sts of the interface Series, an abstract c ass calle c bstractSeries, as well as tra concrete implementations, Lab 5-ITI 1121 ABIC Introduct ITI 1121 Labora s (2019) esearch Textbook Solutions Chex e Read All or The Following instru. x Best Online Java Vener-Beaut. + Ch c Not secure www site.uottawa.ca/gvi/Courses IT11121/le turcs/labs/lab5-2019.html Here is test program that illustrates the internded use of the classes. ublic class TestSeries public ststic vold eai-stringt Bras) SyaLun.uut primLin e irL five L the rithnlic i System.out.prirtin(sn.rexzo mrew Geometric() Syeten.aut-println() ytn.out printin The firat five tar of thwtic series ar: System.out.pritin(tupleln1)i Here is the expected output: The first five terze af the arithsetic seris are The tirst tive terss of the geonetric series sre Lab 5 ITI 1121 ABIC Introduct ITI 1121 Labora s (2019) esearch Textbook Solutions Chex e Read Allor The Following instru + Best Online Java Vener-Beaut C Not secure www site.uottawa.ca/gvi/Courses IT11121/le turcs/labs/lab5-2019.html a @ @@ The first 5 partial sums of the arithmetic series are 52 1 2 3 S 123 6 S1+2+3+1-10 S, 1+2+3+4+5 15 Use the provided template as a starting point. 23 Gmetric Implement the class Geometric, which is a subdlass of AbstractSeries. Each call to the method next produces the next partial surn of the series according to the formula below. The first call returns 1.0, the second call returns 1.5, the third call returns 1.75,etr You can use Math.powta, b), whicn returns , tor vour implementation. The first 5 partial suis of the geometric ser ies are: % = 1 + --++= 1.9375 2816 A call tothe mothod next produces the next partial sum, Le.the next valuc of S. Use Lhe provided templale as a slatLirng pcinStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started