SlideShare a Scribd company logo
1 of 1
Download to read offline
Code in Java using methods. Additionally, have two files, one with the actual methods and
another which will be the tester fil where we will run the main
A run is a sequence of adjacent repeated values. Write a program that generates a sequence of 20
random die tosses in an array and that prints the die values, marking the runs by including them
in parentheses, like this:
1 2 (5 5) 3 1 2 4 3 (2 2 2 2) 3 6 (5 5) 6 3 1
Use the following pseudocode:
inRun = false
For each valid index i in the array
If inRun
If values[i] is different from the preceding value Print ).
inRun = false
If not inRun
If values[i] is the same as the following value
Print (.
inRun = true
Print values[i].
If inRun, print ).

More Related Content

More from akdavinderhosiery

Click the icon to view the data for the four projects Fill in the tabl.pdf
Click the icon to view the data for the four projects Fill in the tabl.pdfClick the icon to view the data for the four projects Fill in the tabl.pdf
Click the icon to view the data for the four projects Fill in the tabl.pdfakdavinderhosiery
 
Click on the Nash Equilibria (one or more) of this game (click on the.pdf
Click on the Nash Equilibria (one or more) of this game (click on the.pdfClick on the Nash Equilibria (one or more) of this game (click on the.pdf
Click on the Nash Equilibria (one or more) of this game (click on the.pdfakdavinderhosiery
 
Click the icon to view the interest and annuity table for discrete com.pdf
Click the icon to view the interest and annuity table for discrete com.pdfClick the icon to view the interest and annuity table for discrete com.pdf
Click the icon to view the interest and annuity table for discrete com.pdfakdavinderhosiery
 
Click and drag the terms on the left to fill in the blanks in the sent (1).pdf
Click and drag the terms on the left to fill in the blanks in the sent (1).pdfClick and drag the terms on the left to fill in the blanks in the sent (1).pdf
Click and drag the terms on the left to fill in the blanks in the sent (1).pdfakdavinderhosiery
 
Click the icon to view the interest factors for discrete compounding w (1).pdf
Click the icon to view the interest factors for discrete compounding w (1).pdfClick the icon to view the interest factors for discrete compounding w (1).pdf
Click the icon to view the interest factors for discrete compounding w (1).pdfakdavinderhosiery
 
Click here to access StatKey- Round your answer for the intercept to o (1).pdf
Click here to access StatKey- Round your answer for the intercept to o (1).pdfClick here to access StatKey- Round your answer for the intercept to o (1).pdf
Click here to access StatKey- Round your answer for the intercept to o (1).pdfakdavinderhosiery
 
Classify each description according to the correct spinal cord structu.pdf
Classify each description according to the correct spinal cord structu.pdfClassify each description according to the correct spinal cord structu.pdf
Classify each description according to the correct spinal cord structu.pdfakdavinderhosiery
 
Classifying Cash Flows Identify whether each of the following would be.pdf
Classifying Cash Flows Identify whether each of the following would be.pdfClassifying Cash Flows Identify whether each of the following would be.pdf
Classifying Cash Flows Identify whether each of the following would be.pdfakdavinderhosiery
 
Classification- The following items are part of the cytoskeleton- Resp.pdf
Classification- The following items are part of the cytoskeleton- Resp.pdfClassification- The following items are part of the cytoskeleton- Resp.pdf
Classification- The following items are part of the cytoskeleton- Resp.pdfakdavinderhosiery
 
Classifying Intangible Costs on the Balance Sheet The adjusted trial b.pdf
Classifying Intangible Costs on the Balance Sheet The adjusted trial b.pdfClassifying Intangible Costs on the Balance Sheet The adjusted trial b.pdf
Classifying Intangible Costs on the Balance Sheet The adjusted trial b.pdfakdavinderhosiery
 
Classification- The following items are organelles found in animal cel (1).pdf
Classification- The following items are organelles found in animal cel (1).pdfClassification- The following items are organelles found in animal cel (1).pdf
Classification- The following items are organelles found in animal cel (1).pdfakdavinderhosiery
 
Classification- The following are basic building blocks of biopolymers.pdf
Classification- The following are basic building blocks of biopolymers.pdfClassification- The following are basic building blocks of biopolymers.pdf
Classification- The following are basic building blocks of biopolymers.pdfakdavinderhosiery
 
Clara did very well on her Biology midterm- The Biology midterm scores.pdf
Clara did very well on her Biology midterm- The Biology midterm scores.pdfClara did very well on her Biology midterm- The Biology midterm scores.pdf
Clara did very well on her Biology midterm- The Biology midterm scores.pdfakdavinderhosiery
 
Clarice- an 11 year-old girl- was eating her school dinner one lunchti.pdf
Clarice- an 11 year-old girl- was eating her school dinner one lunchti.pdfClarice- an 11 year-old girl- was eating her school dinner one lunchti.pdf
Clarice- an 11 year-old girl- was eating her school dinner one lunchti.pdfakdavinderhosiery
 
choose the one correct answer - 33- A good surveillance system shoul.pdf
choose the one correct answer -   33- A good surveillance system shoul.pdfchoose the one correct answer -   33- A good surveillance system shoul.pdf
choose the one correct answer - 33- A good surveillance system shoul.pdfakdavinderhosiery
 
Cladogram or phylogram- What do the colors represent- virustype SARS-.pdf
Cladogram or phylogram- What do the colors represent- virustype  SARS-.pdfCladogram or phylogram- What do the colors represent- virustype  SARS-.pdf
Cladogram or phylogram- What do the colors represent- virustype SARS-.pdfakdavinderhosiery
 
CIS105 (1-7) Build a community-area crime report showing each incident.pdf
CIS105 (1-7) Build a community-area crime report showing each incident.pdfCIS105 (1-7) Build a community-area crime report showing each incident.pdf
CIS105 (1-7) Build a community-area crime report showing each incident.pdfakdavinderhosiery
 
Circled nodes (there are two on this gene tree) represent gene duplica.pdf
Circled nodes (there are two on this gene tree) represent gene duplica.pdfCircled nodes (there are two on this gene tree) represent gene duplica.pdf
Circled nodes (there are two on this gene tree) represent gene duplica.pdfakdavinderhosiery
 
Cipher mechanics 1- monoalphabetic substitution- The small- Greek-spea.pdf
Cipher mechanics 1- monoalphabetic substitution- The small- Greek-spea.pdfCipher mechanics 1- monoalphabetic substitution- The small- Greek-spea.pdf
Cipher mechanics 1- monoalphabetic substitution- The small- Greek-spea.pdfakdavinderhosiery
 
Choose the correct statement- A- Growth in average hours per work incr.pdf
Choose the correct statement- A- Growth in average hours per work incr.pdfChoose the correct statement- A- Growth in average hours per work incr.pdf
Choose the correct statement- A- Growth in average hours per work incr.pdfakdavinderhosiery
 

More from akdavinderhosiery (20)

Click the icon to view the data for the four projects Fill in the tabl.pdf
Click the icon to view the data for the four projects Fill in the tabl.pdfClick the icon to view the data for the four projects Fill in the tabl.pdf
Click the icon to view the data for the four projects Fill in the tabl.pdf
 
Click on the Nash Equilibria (one or more) of this game (click on the.pdf
Click on the Nash Equilibria (one or more) of this game (click on the.pdfClick on the Nash Equilibria (one or more) of this game (click on the.pdf
Click on the Nash Equilibria (one or more) of this game (click on the.pdf
 
Click the icon to view the interest and annuity table for discrete com.pdf
Click the icon to view the interest and annuity table for discrete com.pdfClick the icon to view the interest and annuity table for discrete com.pdf
Click the icon to view the interest and annuity table for discrete com.pdf
 
Click and drag the terms on the left to fill in the blanks in the sent (1).pdf
Click and drag the terms on the left to fill in the blanks in the sent (1).pdfClick and drag the terms on the left to fill in the blanks in the sent (1).pdf
Click and drag the terms on the left to fill in the blanks in the sent (1).pdf
 
Click the icon to view the interest factors for discrete compounding w (1).pdf
Click the icon to view the interest factors for discrete compounding w (1).pdfClick the icon to view the interest factors for discrete compounding w (1).pdf
Click the icon to view the interest factors for discrete compounding w (1).pdf
 
Click here to access StatKey- Round your answer for the intercept to o (1).pdf
Click here to access StatKey- Round your answer for the intercept to o (1).pdfClick here to access StatKey- Round your answer for the intercept to o (1).pdf
Click here to access StatKey- Round your answer for the intercept to o (1).pdf
 
Classify each description according to the correct spinal cord structu.pdf
Classify each description according to the correct spinal cord structu.pdfClassify each description according to the correct spinal cord structu.pdf
Classify each description according to the correct spinal cord structu.pdf
 
Classifying Cash Flows Identify whether each of the following would be.pdf
Classifying Cash Flows Identify whether each of the following would be.pdfClassifying Cash Flows Identify whether each of the following would be.pdf
Classifying Cash Flows Identify whether each of the following would be.pdf
 
Classification- The following items are part of the cytoskeleton- Resp.pdf
Classification- The following items are part of the cytoskeleton- Resp.pdfClassification- The following items are part of the cytoskeleton- Resp.pdf
Classification- The following items are part of the cytoskeleton- Resp.pdf
 
Classifying Intangible Costs on the Balance Sheet The adjusted trial b.pdf
Classifying Intangible Costs on the Balance Sheet The adjusted trial b.pdfClassifying Intangible Costs on the Balance Sheet The adjusted trial b.pdf
Classifying Intangible Costs on the Balance Sheet The adjusted trial b.pdf
 
Classification- The following items are organelles found in animal cel (1).pdf
Classification- The following items are organelles found in animal cel (1).pdfClassification- The following items are organelles found in animal cel (1).pdf
Classification- The following items are organelles found in animal cel (1).pdf
 
Classification- The following are basic building blocks of biopolymers.pdf
Classification- The following are basic building blocks of biopolymers.pdfClassification- The following are basic building blocks of biopolymers.pdf
Classification- The following are basic building blocks of biopolymers.pdf
 
Clara did very well on her Biology midterm- The Biology midterm scores.pdf
Clara did very well on her Biology midterm- The Biology midterm scores.pdfClara did very well on her Biology midterm- The Biology midterm scores.pdf
Clara did very well on her Biology midterm- The Biology midterm scores.pdf
 
Clarice- an 11 year-old girl- was eating her school dinner one lunchti.pdf
Clarice- an 11 year-old girl- was eating her school dinner one lunchti.pdfClarice- an 11 year-old girl- was eating her school dinner one lunchti.pdf
Clarice- an 11 year-old girl- was eating her school dinner one lunchti.pdf
 
choose the one correct answer - 33- A good surveillance system shoul.pdf
choose the one correct answer -   33- A good surveillance system shoul.pdfchoose the one correct answer -   33- A good surveillance system shoul.pdf
choose the one correct answer - 33- A good surveillance system shoul.pdf
 
Cladogram or phylogram- What do the colors represent- virustype SARS-.pdf
Cladogram or phylogram- What do the colors represent- virustype  SARS-.pdfCladogram or phylogram- What do the colors represent- virustype  SARS-.pdf
Cladogram or phylogram- What do the colors represent- virustype SARS-.pdf
 
CIS105 (1-7) Build a community-area crime report showing each incident.pdf
CIS105 (1-7) Build a community-area crime report showing each incident.pdfCIS105 (1-7) Build a community-area crime report showing each incident.pdf
CIS105 (1-7) Build a community-area crime report showing each incident.pdf
 
Circled nodes (there are two on this gene tree) represent gene duplica.pdf
Circled nodes (there are two on this gene tree) represent gene duplica.pdfCircled nodes (there are two on this gene tree) represent gene duplica.pdf
Circled nodes (there are two on this gene tree) represent gene duplica.pdf
 
Cipher mechanics 1- monoalphabetic substitution- The small- Greek-spea.pdf
Cipher mechanics 1- monoalphabetic substitution- The small- Greek-spea.pdfCipher mechanics 1- monoalphabetic substitution- The small- Greek-spea.pdf
Cipher mechanics 1- monoalphabetic substitution- The small- Greek-spea.pdf
 
Choose the correct statement- A- Growth in average hours per work incr.pdf
Choose the correct statement- A- Growth in average hours per work incr.pdfChoose the correct statement- A- Growth in average hours per work incr.pdf
Choose the correct statement- A- Growth in average hours per work incr.pdf
 

Recently uploaded

Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 

Recently uploaded (20)

Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 

Code in Java using methods- Additionally- have two files- one with the.pdf

  • 1. Code in Java using methods. Additionally, have two files, one with the actual methods and another which will be the tester fil where we will run the main A run is a sequence of adjacent repeated values. Write a program that generates a sequence of 20 random die tosses in an array and that prints the die values, marking the runs by including them in parentheses, like this: 1 2 (5 5) 3 1 2 4 3 (2 2 2 2) 3 6 (5 5) 6 3 1 Use the following pseudocode: inRun = false For each valid index i in the array If inRun If values[i] is different from the preceding value Print ). inRun = false If not inRun If values[i] is the same as the following value Print (. inRun = true Print values[i]. If inRun, print ).