Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

peckage wititisovetiond pebtic elasu Rectangin wirnds shet is orlate ist letop, =iatiry malic Mectangin wimt teidh, ler wetent 8 7 polic wede andeblacefaraletersilat ten, let

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
peckage wititisovetiond pebtic elasu Rectangin wirnds shet is orlate ist letop, =iatiry malic Mectangin wimt teidh, ler wetent 8 7 polic wede andeblacefaraletersilat ten, let widi e leseth = inti 1 lesth = inti with = wili potie wede changeshabeharkneterst] \& ares on lesath o widthy pultie wif calcartaheriepteril of aren at at perineter 3 peckage midtermburitiand! Ablic clas Sguse ertanes shape of privote int sistiegth: pubtic soape inat all \& 7 sideiengen = 13 pubtic string dislayshaped I i return "erea * o area * " perineter * o periseter * 1 poblic veid changesinasefaranetersine tent f. 3idetesgth = teni publif weld calcareaperimeteri) if ult woid icatcarearerineteris f area a sidetength o sidetedghth 1 perineter o a a sidelengtad A) P i i (aj i il 4 Voce antiner expecifir A A Cicr bi Vair ahinder (ipecify A,0, or oj Question 2 Which of the folkwng aro overiaturn mithots in thr fectangit class voor arsare: itpectrin in ar by Question 4 What is the cutpot of the Usingshapes progame. A) area=0perinefer9area=100perimetier40area=soperinticineso (a) area=9Detimeter0area=100perimeter40area=50perindeter39 atea = 0 perimeter a meg = 100 penmeter 40 tide tength = 10 atea =50 perineter 30 D) area a 0 penimeler 0 ared =100 perimeter a0 ade fength =10 area =50 perimefer 60 . packepe midterovestiond: poblic etan shace f protected iat arest pratecten int arerineterd Matie shapeti 4 ares = Ez. perineter o potile Arctanele fint length, int wath 8 this. length = Iengthe this, wieth = wittht pubtie vaid changeihapeparaneterstimt let, int wes it length = len: wieth = wids potis neie changethapebiarantersid ( i pubtic void calcareaferineter() \& area w length o wathi aublik veid catcareaperineteri) (f periseter =2 a (length + wideth) area =1 the 3 aerineter =14 tic class bingshages if pockoge miftermouestiont; Lie itatie vaid mantstring org shape sh Il = nta Shaget3] pubtic ctass Square entends shape f privete int sidelength. shiol = new shape(l) sh(i) = new Square(1a) public squarelint s1] \{ sh shil = sen mectarote(ie, 511 sidelebgen o th for tiet 1 = e 1 1(++1){ 3 sh(if.calcareaferimeter(i) pubtie string displayshasel) \& Srsten-evt.peint in on tif. displayshape (x): 1 public vaid changetbapefaranetera(int (en) f. 3) sidetength o lent pubtic void caledreaferineter (\} if area = sidelength o sidelength Question 1: How many data members in totat does the roctangle class have? Specify A, B, C, or D A) 2 b) 1 c) 3 o) 4 Your anawer (speaify A, B, C, or D) Question 2: Which of the folfowing are overleaded methods in the rectangle class? A) caleAreaperimeter e) changeshapeparametera C) changeshape D) There are no overlosded methods Your answer (specify A, B, C, or D) Question 3. Which of the following are overtidden methods in the rectangle class? A) calcAteaPenimeter B) changestapeParameters C) changeshape D) There are no overniden methods Your antwer: (Specify A, B, C, or D) Question 4: What is the output of the UsingShopes program? A). area in 0 perimeter 0 ares =100 perimeter 40 area =50 perimeter 60 B) area =0 perimeter 0 area =100 perimeter 40 area =50 perimeter 30 C) area=0perimeter0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

What is meant by planning or define planning?

Answered: 1 week ago