Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1.9. Trace the following algorithm for n = 8,490,725,727, 154,368, 726, 402,945. 1. Input a positive integer n 2. d number of digits of

image text in transcribed
Question 1.9. Trace the following algorithm for n = 8,490,725,727, 154,368, 726, 402,945. 1. Input a positive integer n 2. d number of digits of n 3. While d> 1 do 3.1. n sum of digits of n 3.2 d number of digits of n 4. Output n Question 1.10. Trace the following algorithm for (a) string of integers 274390 to see if the integer 8 - 9 is contained in the string, (b) string of integers 730285 to see if the integer s = 2 is contained in the string, (c) string of integers 983650362 to see if the integer s = 5 is contained in the string, 1. Input string ..., in n and s 2. For i = 1 to n do 2.1. If x, =s then 2.1.1. Return "String contains s." 3. Return "String does not contain s

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions