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

  Windows client server environment

Describe and critically evaluate the similarities between the Windows and Unix operating systems and Identify and Describe the processes involved in the Windows Client Server environment.

  Designing phase of the project management life cycle

Discuss how does the design phase of the project management life cycle differ in content and importance from the other phases?

  C program that prompts the user to enter some data

If the user enters -999 as the first account number, the program should simply exit, and display an appropriate message of your choice.

  Personal or home use of linux

The paper shall only address business requirements and concerns, not personal or home use of Linux.

  Creating a child process

Modify the shell interface program so that is provides a history feature that allows the user to access the most recently entered commands.

  Enable multimedia on a website

Few multimedia can be hard to watch on a mobile device due to screen size or bandwidth limitations. Determine two articles that discuss considerations and new developments that will enable multimedia on a site

  Efficient way of transferring files over the internet

What is an efficient way of transferring files over the Internet? What is the default shell that is used by most versions of Linux called? What is the command that will move the file /cust/newdata to /archive/olddata

  What is the subnet mask

Give the network number, local broadcast and the usable IP address ranges for the 5000th, 50000th & 150000th networks

  1 what does it mean to say that a programming language is

1. what does it mean to say that a programming language is machine independent?2. name and describe four different

  Risk management analysis on business

Approximately 3-5 page report, 1.5 spaced describing an analytics, management science or model challenge in the real world and the methods and/or technologies used to solve it. Five (5) references are required which can be a combination of articl..

  One page document describing security

Analyze the Internet and construct a one page document describing how security is maintained while transacting business over the Internet.

  What operating system use to edit audio and video clips

Design and edit audio and video clips for school projects. What operating system must library consider for this facility? Explain why?

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