CSC205_FinalExamStudyGuide

Urnv1v ytmotpit1p1 sseurnv1v ytmotpit2p2 cretnorc

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: Cret/norc orc Icret Sse.u.rn(v ue.1; ytmotpit"1="+sprv) Cret/norc orc Icret Sse.u.rn(v 3; ytmotpit"3="+v) Cret/norc orc Icret sprv ue.5+1 ue.5=sprv ; Cret/norc orc Icret } } pbi ls etr ulccasTse { pbi ttcvi an(tig]ag) ulcsai odmi Srn[ rs { Prn 1=nwPrn(; aetp e aet) Cret/norc orc Icret Cidc e hl(; hl 1=nwCid) Cret/norc orc Icret Prn 2=nwCid) aetp e hl(; Cret/norc orc Icret Cidc e aet) hl 2=nwPrn(; Cret/norc orc Icret Sse.u.rn(v 1v) ytmotpit"1="+p.1; Sse.u.rn(v 1v) ytmotpit"2="+p.2; Cret/norc orc Icret Cret/norc orc Icret Sse.u.rn(x 1x) ytmotpit"2="+c.2; Cret/norc orc Icret Sse.u.rn(v 1v) ytmotpit"1="+c.1; Cret/norc orc Icret Sse.u.rn(v aetv) ytmotpit"3="+Prn.3; Cret/norc orc Icret Sse.u.rn(v aetv) ytmotpit"4="+Prn.1; Cret/norc orc Icret Sse.u.rn(f aetf() Cret/norc ytmotpit"1="+Prn.1); orc Icret Sse.u.rn(f aetf() Cret/norc ytmotpit"2="+Prn.2); orc Icret } } b. Write Java Code for a method: An array has a triple, if the same element occurs in three consecutive locations. For example, A = {3, 7, 5, 5, 5, 9} has a triple; but B = {3, 5, 7, 5, 5, 9} does not have a triple. Write a method called hasTriple(int a) that returns true if the array has a triple and false otherwise. Documentation: You have...
View Full Document

Ask a homework question - tutors are online