Identify all of the substrings that form numbers

Assignment Help Operating System
Reference no: EM13945549

Could you explain or convert each of the code , symbols used in the following solution?
For example what would "itiny_mce_markerquot; mean for me?
i=1 TO LEN(i$) etc
What would j mean for me? etc
i + 1 TO 1 STEP - 1 etc
MOD 3) = 0 THEN PRINT MID$(i$, i, j) etc

Given a string of numbers, identify all of the substrings that form numbers that are divisible by 3. For example, applying the algorithm on the string 37540 should produce the following substrings (not necessarily in this order): 0; 3; 75; 54; 375; 540

1 i$ = "37540" 'input string
2 FOR i = 1 TO LEN(i$) 'loop from 1 to the length of the input string
3 FOR j = LEN(i$) - i + 1 TO 1 STEP -1
4 'loop from the lenght from this point in the string to the end, down to 1
5 IF (VAL(MID$(i$, i, j)) MOD 3) = 0 THEN PRINT MID$(i$, i, j)
6 'using the modulo function, we check if the particular number is
'evenly divisible by 3
7 NEXT j 'end looping
8 NEXT i 'end looping

For example: 5469
5+4+6+9=24
2+4=6
therefore 5469 is evenly divisible by 3 or 5469 MOD 3 = 0

Reference no: EM13945549

Questions Cloud

Describe an efficient erew algorithm to form a list : Consider an n-element list in an n-processor EREW parallel random-access machine, where some elements of the list are marked as being blue. Describe an efficient parallel algorithm to form a new list consisting of all the blue elements.
Possibility of improving the properties by modifying : Describe the composition, crystal structure & its typical defects, microstructure & phases; properties important for the selected applications, their dependence on the structure, possibility of improving the properties by modifying the structure a..
Define the schengen agreement - what is it : Define the Schengen Agreement: What is it? Why was it put in place? How does it aim to achieve the EU goal of an "ever closer union?" What is Frontex? What is being proposed as a replacement, and why
What are two types of air pollutants : Are the selected air pollutants considered primary or secondary pollutants and why they are considered to be primary or secondary and discuss the sources of these pollutants?
Identify all of the substrings that form numbers : Could you explain or convert each of the code , symbols used in the following solution?
Estimating required rates of return for projects : The Opinion and Analysis section should demonstrate your critical thinking and analysis of the subject matter - the Overview/Summary section should include a statement of the author's hypothesis or proposition.
Upper spec limit and lower spec limit : Calculate Cp (Capability ratio) and Cpk (Capability index) from the following data:
Statistical difference exist between vendors : Perform an ANOVA analysis on the data at p=0.01 to determine if any statistical difference exist between vendors.
What are some takeaways in building an oil refinery : What are some economic, environmental, and political issues in building an automotive manufacture plant? Could the auto planet propose better opportunities for towns people that have lost their job?

Reviews

Write a Review

Operating System Questions & Answers

  When would we overwrite bob''s database, and with what

Suppose we are using Lamport's hash, and Bob's system crashes before receiving Alice's reply to a message. Further suppose an intruder, Trudy, can eavesdrop and detect that Bob crashed (maybe Trudy can even cause Bob to crash).

  Write a report outlining methods of acquiring image in linux

Write a 300-500 words report outlining two methods of acquiring an image in Linux. Student can use Kali and Ubuntu Linux virtual machine (VM) images provided in this subject's lab.

  Program to calculate numeric grades for a course

Create a program to calculate numeric grades for a course. The course records are in a document that will serve as the input document.

  Why they were chosen over alternative methods.

I need a plan for how Boardman Managment Group should utilize Smith Systems Consulting as an outside consultant for this project

  Identifying wireless network architectures

Some of the local hospital's administrators are questioning privacy of patients' data with wireless transmission. Discuss and determine the merits of their concerns.

  Evaluating performance improvement options

Processor X has a clock speed of 2Ghz and takes one cycle for integer operations, two cycles for memory operations, and four cycles for floating point operations.

  Tasks that a linux administrator performs

It is clear that the HWBS administration staff is a junior staff that has mostly focused on Windows servers. They are concerned that the tasks that they will need to learn will cause a tremendous amount of unneeded stress. Describe to the staff th..

  Potential security threats to managing information

Suppose that you have been asked to consult for a corporation that has branch offices in four continents. You have implemented a management data system that will enable its managers to exchange information.

  What is the purpose of system programs

What is the purpose of system calls and what are the major activities of an operating system with regard to process management - What is the purpose of system programs

  Question 1a enumerate the objectives of a procurement

question 1a enumerate the objectives of a procurement development modelb describe one procurement development model you

  Race condition

Race Condition:  A situation in which multiple threads or processes read and write a shared data item and the final result depends on the relative timing of their execution.

  Roles of network managers

In Many development companies and universities network managers must oversee a network that has several computers connected to it that are used through developers for design and product development reason.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd