Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java PART A: Introduction In mathematics, the look-and-say sequence is the sequence of integers beginning as follows: 1,11,21, 1211, 111221, 312211, 13112221, 11132132,. To

image text in transcribed in java
PART A: Introduction "In mathematics, the look-and-say sequence is the sequence of integers beginning as follows: 1,11,21, 1211, 111221, 312211, 13112221, 11132132,. To generate a member of the sequence from the previous member, read off the digits of the previous member, counting the number of digits in groups of the same digit. For example: 1 is read offas one 1" or 11. 11 is read off as "two ls" or 21 21 is read off as "one 2, then one l" or 1211. 1211 is read off as "one l, one 2, then two ls" or 1 1 1221. 111221 is read off as "three 1s, two 2s, then one 1" or 312211 If we start with any digit d from 0 to 9 then d then the sequence starts as follows d, 1d, 111d, 311d, 13211d, 111312211d, 31131122211d"1 Problem . Write a program that: a. Read a long integer number as an array list b. Apply on this number( list) look-and-say technique to give next sequence of that number. Example if the user enter 3122" then he will get"13112221" Display the result as: 312211=-Look and Say== 13112221Hints: Use enhanced for loop to display the result. c. https//en.wikipedia.org/wiki/Look-and-say sequence, 2016

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

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions