Advice on How to write Algorithm in ISC Computer Computer Practical | Guide ...
http://www.guideforschool.com/1611744 http://www.guideforschool.com/1611744-advice-on-how-to-write-algor... -advice-on-how-to-write-algor...
Number (http://www.guideforschool.com/category/number-related-programs/) String (http://www.guideforschool.com/category/string-related-programs/) Array (http://www.guideforschool.com/category/array-related-programs/) Date (http://www.guidefor (http://www.guideforschool.com/ school.com/category/d category/date-related-prog ate-related-programs/) rams/) Recursion (http://www.guideforschool.com/category/recursion-related-programs/)
(https://twitter.com /guideforschool) (http://www.facebook.com /guideforschool) (http://www.guideforschool.com /feed/)
Inheritance (http://www.guideforschool.com/category/inheritance-relatedprograms/)
I have been getting many queries requesting me to upload tutorials on how to write algorithms for a program in the ISC Computer Science Practical Examination. Teaching how to write algorithms by writing an article on it is not that effective, but I decided to put down algorithms of two different programs which would serve as examples on how you should proceed with writing algorithms of your program. Note: There Note: There are various ways in which you can write algorithms. I am putting down the easiest form of writing algorithm. This style is completely acceptable in ISC Computer Science Practical Examination and really easy to understand. All you need to do in order to understand the algorithms and write them, is by having in front of yourself, the program whose algorithm is given below. Go through the program and the algorithm and you will get an idea on how to write algorithms. After all, writing algorithms isn’t a mammoth task as we see it to be. They are just logical steps written in order in an easy to understand language which when put together in a programming language will result in the solution. Also Note: Before writing your program in your answer sheet, you need to write the algorithm for it. Now what I would suggest you to do is, when you get your answer sheet, solve the program you have selected using pencil at the end of your paper (last paper (last 2-3 pages). Write “Rough” above the pages. pages . Once you are done with writing the program in pencil, begin writing your answers in fair from the front page. Begin by writing the algorithm by seeing the rough program you wrote at the back. Then Write the program in fair using pen, just after your algorithm. algorithm. Then erase what you wrote in pencil at the last pages of your answer sheet. I know you have to write the program twice but it has its own advantages like: 1) You 1) You can easily write the algorithm by seeing the program 2) Your 2) Your final program in fair will be neat as you will just be copying it from the back pages. 3) If 3) If you started a program with pencil and after 10 minutes you realize that you should choose other program, you can do so as you haven’t written anything in pen yet.
������� ��
1 f 10
15 02 2015 19 41
Advice on How to write Algorithm in ISC Computer Practical | Guide ...
http://www.guideforschool.com/1611744-advice-on-how-to-write-algor...
Example of Algorithm of a program which contains only main() method First see this program: http://www.guideforschool.com/1260759-java-program-to-print-circular-spiral-matrix/ (http://www.guideforschool.com/1260759-java-program-to-print-circular-spiral-matrix/) (http://www.guideforschool. )
Step 1 :
Start of algotithm
Step 2 :
Input the size of circular matrix and store it in integer variable ‘n’
Step 3 :
Create an integer square array of size ‘n*n’ which will be the circular matrix
Step 4 :
Declare and initialize variables k = 0 (for filling the matrix), c1 = 0 (for storing index of first column), c2 =
n-1 (for storing index of last column), r1 = 0 (for storing index of first row), r2 = n-1 (for storing index of last row) Step 5 :
Start a while loop till k<=n*n and repeat steps 6 to 10
Step 6 : (a)
Start a for loop from i = c1 to c2, where ‘i’ increases by 1 every time and perform step (b)
(b)
Store the natural numbers in the first row using A[r1][i] = k++
Step 7 : (a)
Start a for loop from j = r1+1 to r2, where ‘j’ increases by 1 every time and perform step (b)
(b)
Store the natural numbers in the last column using A[j][c2] = k++
Step 8 : (a)
Start a for loop from i = c2-1 to c1, where ‘i’ decreases by 1 every time and perform step (b)
(b)
Store the natural numbers in the last row using A[r2][i] = k++
Step 9 : (a)
Start a for loop from j = r2-1 to r1+1, where ‘j’ decreases by 1 every time and perform step (b)
(b)
Store the natural numbers in the first column using A[j][c1] = k++
Step 10 :
Update the variables c1, c2, r1 and r2
Step 11 :
Display the circular matrix A[ ]
Step 12 :
End of Algorithm
������� ��
Example of Algorithm of a program which contains other methods along with the main() method First see this program: http://www.guideforschool.com/358-isc-2013-question-3-practical-paper-solved/ (http://www.guideforschool.com/358-isc-2013-question-3-practical-paper-solved/) Note: In such cases, start with first writing the algorithm for the main() method and then the algorithm for the other methods.
Algorithm for main() method : Step 1 :
Start of algotithm
Step 2 :
Input the sentence and store it in a String variable ‘s’
LATEST Step 3
2 f 10
Computer Applications (http://www.guideforschool.com/1 : ICSE 2014Convert the sentencePaper into Solved upper case
© www.guideforschool.com | Designed By -
15 02 2015 19 41
Advice on How to write Algorithm in ISC Computer Practical | Guide ...
http://www.guideforschool.com/1611744-advice-on-how-to-write-algor...
Create a StringTokenizer object ‘str’ to extract tokens (words) from the sentence using space and other the
Step 4 :
punctuation marks namely ‘.’, ‘?’, ‘!’ Step 5 : Count the number of tokens (words) and store it in an integer variable ‘c’. Also create a String array word[ ] (http://www.guideforschool. ) of size ‘c’ Step 6 :
Start a for loop from i = 0 to less than ‘c’ and store the tokens of the sentence into the word [ ] array
Step 7 :
Declare an integer variable ‘count’ and initialize it with 0
Step 8 :
Start a for loop from i = 0 to less than ‘c’ and repeat step 9
Step 9 :
Call the function isPalin() as : ob.isPalin(word[i]). If the returned value is ‘true’ then increase the count
variable and print the word. Step 10 :
If count of palindromic words is not equal to zero, then print the value stored in the variable ‘count’
Step 11 :
End of algorithm for main() method
Algorithm for function boolean isPalin(String s) : Step 1 :
Start of algorithm for function isPalin()
Step 2 :
Find the length of the String ‘s and store it in an integer variable ‘l’
Step 3 :
Declare and initialize a String variable rev=”” for storing the reverse of the String ‘s’
Step 4 :
Start a reverse for loop from i = l-1 to 0 and repeat step 5
Step 5 :
Extract characters from the end of the original string and add them to the variable ‘rev’
Step 6 :
If the reverse word obtained (rev) is equal to the original String (s), then return true, otherwise return false.
Step 7 :
End of algorithm for the function isPalin().
Similarly if you have more functions, then just write their algorithms in a similar fashion one after the other. This is how you can write algorithms in your ISC Practical Examination. So, as you see, this is nothing but step wise solution to the given program in English language. So just relax! It isn’t a big deal to write algorithms now. You can easily get a 10/10 in the algorithm part now. Smile. Share this: Like
Tweet
13
0
Related
Top 5 Advice regarding ISC Computer Practical (http://www.guideforschool.com /1330124-top-5-advice-regardingisc-computer-practical/)
Tweet
LATEST
3 f 10
ISC 2010 Computer Science Solution and Examiner's Comments - From the Council (http://www.guideforschool.com /1947206-isc-2010-computerscience-solution-and-examinerscomments-from-the-council/)
Some Operations on Linked List using Java (http://www.guideforschool.com /1137558-some-operationson-linked-list-using-java/)
0
ICSE 2014 Computer Applications Paper Solved
(http://www.guideforschool.com/1
© www.guideforschool.com | Designed By -
15 02 2015 19 41
Advice on How to write Algorithm in ISC Computer Practical | Guide ... February 19, 2014 - 1:26 am
http://www.guideforschool.com/1611744-advice-on-how-to-write-algor...
Class 12 (http://www.guideforschool.com/category/class-12/), Important Lessons
(http://www.guideforschool.com/category/important-lessons/), Important Tips (http://www.guideforschool.com/category/important-tips/), ISC Important Notes (http://www.guideforschool.com/category/isc-important-notes/)
(http://www.guideforschool.)
242 views
MZA (http://www.guideforschool.com/author/guidefs/) A teacher whose aim is to make Java a fun to learn experience for the school students by striving to build clear fundamentals of every concepts and helping students to develop their ability to reason and logically analyze any given programs.
(http://www.guideforschool.com /author/guidefs/)
VISHAL TIWARI February 12, 2015 at 9:08 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-1335) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=1335#respond)
will i get full marks by writing this type of algo
MZA February 12, 2015 at 9:36 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/#comment-1337) - Reply (/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/?replytocom=1337#respond)
Yes.
Moon June 17, 2014 at 9:41 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-648) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=648#respond)
how to run a program of inheritance in bluej?? plzzz help
Java For School (http://www.guideforschool.com/) July 10, 2014 at 12:15 am (http://www.guideforschool.com/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/#comment-649) - Reply (/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/?replytocom=649#respond)
See a sample program: http://www.guideforschool.com/417291-question-11-inheritanceisc-2013-theory-paper-solved/ (http://www.guideforschool.com/417291-question11-inheritance-isc-2013-theory-paper-solved/) LATEST
4 f 10
ICSE 2014 Computer Applications Paper Solved
(http://www.guideforschool.com/1
© www.guideforschool.com | Designed By -
15 02 2015 19 41
Advice on How to write Algorithm in ISC Computer Practical | Guide ...
http://www.guideforschool.com/1611744-advice-on-how-to-write-algor...
Joseph February 19, 2014 at 10:02 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer-
(http://www.guideforschool. ) practical/#comment-646) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=646#respond)
sir,should we write comments in the algorithm if we are writing in pseudo code…
Java For School (http://www.guideforschool.com) February 19, 2014 at 10:08 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/#comment-647) - Reply (/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/?replytocom=647#respond)
Yes brief comments.
dipanjan February 19, 2014 at 9:05 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-644) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=644#respond)
is it must we have to use tokeniser in the 3rd string program?
Java For School (http://www.guideforschool.com) February 19, 2014 at 9:11 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/#comment-645) - Reply (/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/?replytocom=645#respond)
No, you can do it without using StringTokenizer also.
megha February 19, 2014 at 6:19 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-640) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=640#respond)
is it necessary to write comments in t he program? or is it okay if we jus t write the variable description? please reply asap sir.
Java For School (http://www.guideforschool.com) February 19, 2014 at 6:25 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/#comment-641) - Reply (/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/?replytocom=641#respond)
Do write the comments also. Just 7-8 comments will do.
megha February 19, 2014 at 6:41 pm (http://www.guideforschool.com/1611744- advice-on-how-to-write-algorithm-in-isc-computer-practical/#comment-642) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=642#respond)
u mean just a few comments for the main logic of the program will do?
Java For School (http://www.guideforschool.com) February 19, 2014 at 7:07 pm LATEST
5 f 10
ICSE 2014 Computer Applications Paper Solved
© www.guideforschool.com | Designed By (http://www.guideforschool.com/1 (http://www.guideforschool.com/1611744-advice-
15 02 2015 19 41
Advice on How to write Algorithm in ISC Computer Practical | Guide ...
http://www.guideforschool.com/1611744-advice-on-how-to-write-algor...
on-how-to-write-algorithm-in-isc-computer-practical/#comment-643) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc- computer-practical/?replytocom=643#respond)
Yes (http://www.guideforschool. )
Anna February 19, 2014 at 5:33 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-636) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=636#respond)
we don’t have to write flowchart , sir??
Java For School (http://www.guideforschool.com) February 19, 2014 at 5:39 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/#comment-637) - Reply (/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/?replytocom=637#respond)
No.
Anna February 19, 2014 at 2:30 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-631) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=631#respond)
how to write documentation , please help??
Java For School (http://www.guideforschool.com) February 19, 2014 at 4:10 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/#comment-632) - Reply (/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/?replytocom=632#respond)
The 3rd Instruction in the practical question paper is referred to as the documentation: “3. Document the program using mnemonic names / comments, identifying and clearly describing the choice of data types and m eaning of variables.” In this you need to write comments in your program and after you have finished writing your program, write the Data Description Table for it which consists of mostly 3 columns – Identifier/Variable Name, Data Type and Purpose. For example: The data description table for the below given code would be: Code:
1 2 3 4 5 6 7 8 � 10 11 12 13
���� �������( ��� �)
� ��� � � 0� ���(��� � �
1� �&������ �++)
� ��(�%�
�� 0) �++�
� ��(�
�� 2) ������.���.�������(&�������� ������ �� �����&�����)�
����
������.���.�������(&�������� ������ �� ��� �����&�����)� �
Data Description: LATEST
6 f 10
Identifier Name ICSE 2014 Computer Applications Paper Solved
Data Type Purpose© www.guideforschool.com | Designed By (http://www.guideforschool.com/1 15 02 2015 19 41
Advice on How to write Algorithm in ISC Computer Practical | Guide ...
http://www.guideforschool.com/1611744-advice-on-how-to-write-algor...
n
int
variable to store the number
c
int
variable to count the number of factors of n
i int (http://www.guideforschool. )loop control variable Hope this helps. Regards, guideforschool
gopika (http://www.guideforschool.com) February 19, 2014 at 1:53 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-630) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=630#respond)
sir can u post a simpler code for extracting a word from a sentence.pls.
Java For School (http://www.guideforschool.com) February 19, 2014 at 4:27 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/#comment-634) - Reply (/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/?replytocom=634#respond)
Yes Gopika, there are alternative codes for extracting words from a s entence. It is up to you to judge which is simpler and which is not. Here is a code which extracts words from a sentence and saves it in a String variable w.
1 2 3 4 5 6 7 8 � 10 11 12 13 14 15 16 17 18
������.���.�����(&���������� ��� �������� � &�����)� ������ � � ��.��������()� ��� � � �.������()� ��� ����0� ������ �� ���(��� ��0��&������++) � ��(�.������(�)��' ') � � � �.���������(���,�)� /* ����� ��� ��������� ��� ���� �� ������� ���� * ��� ��� ���� ���� '�' �� ��� �������� �� ��� */ �����+1� � �
Anna February 19, 2014 at 5:39 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/#comment-638) - Reply (/1611744-advice-on-how-to-write- algorithm-in-isc-computer-practical/?replytocom=638#respond)
String a1=”Hello world this is jackass” String[] a2=a1.split(” “); // if you know words are separated by space , it will put all it in array
Java For School (http://www.guideforschool.com) February 19, 2014 at 6:07 pm (http://www.guideforschool.com/1611744- advice-on-how-to-write-algorithm-in-isc-computer-practical/#comment-639) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical LATEST
7 f 10
ICSE 2014 Computer Applications Paper Solved
(http://www.guideforschool.com/1 /?replytocom=639#respond)
© www.guideforschool.com | Designed By -
15 02 2015 19 41
Advice on How to write Algorithm in ISC Computer Practical | Guide ...
http://www.guideforschool.com/1611744-advice-on-how-to-write-algor...
Thank you Anna. Yes, this is another way which we have used in some programs. It is the easiest way when you have to save the words of a sentence in an array.
(http://www.guideforschool. )
Just note: If there are 2 spaces in between any words or a fullstop followed by a space as in “Java is Fun. Said none”, the above code needs to be modified otherwise it will store null strings also in the array. Just use this syntax: String word[]=s.split(“[. ]+”); where ‘s’ is the sentence. Similarly you can use other punctuation marks by putting them inside like this “[?!,;. ]+”
[email protected] (http://dark-hackerz.blogspot.com/) February 19, 2014 at 1:17 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-629) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=629#respond)
Thank You
Thank You very much, it helped a lot
megha February 19, 2014 at 1:45 am (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-627) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=627#respond)
is it not okay if in fair itself we first write the program and then the algorithm? does the order matter?
LATEST
8 f 10
ICSE 2014 Computer Applications Paper Solved
(http://www.guideforschool.com/1
© www.guideforschool.com | Designed By -
15 02 2015 19 41
Advice on How to write Algorithm in ISC Computer Practical | Guide ...
http://www.guideforschool.com/1611744-advice-on-how-to-write-algor...
Java For School (http://www.guideforschool.com) February 19, 2014 at 1:48 am (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical
(http://www.guideforschool. ) /#comment-628) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical/?replytocom=628#respond) The correct order is to write algorithm first and th en the program. Even in the question paper you are told to follow this order. Read the instructions given in ISC Practical Papers. Here is one: http://www.guideforschool.com/wp-content/uploads/2013/04 /ISC-2013-Computer-Science-Paper-2-Practical.pdf (http://www.guideforschool.com/wp-content/uploads/2013/04/ISC-2013Computer-Science-Paper-2-Practical.pdf)
Ankita February 19, 2014 at 4:17 pm (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc- computer-practical/#comment-633) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=633#respond)
the correct sequence is wat u r saying but leaving 1-2 pages we can start writing the program nd later write the algo based on our program…. ??? can we do this???
Java For School (http://www.guideforschool.com) February 19, 2014 at 4:29 pm (http://www.guideforschool.com/1611744-advice-on-how- to-write-algorithm-in-isc-computer-practical/#comment-635) - Reply (/1611744-advice- on-how-to-write-algorithm-in-isc-computer-practical/?replytocom=635#respond)
Yes you can do this.
megha February 19, 2014 at 1:43 am (http://www.guideforschool.com/1611744-advice-on-how-to-write-algorithm-in-isc-computer- practical/#comment-626) - Reply (/1611744-advice-on-how-to-write-algorithm-in-isc-computer-practical /?replytocom=626#respond)
I always faced a problem in writing algorithms. But this post is really helpful. Thankyou.
Your Turn To Talk Your email address will not be published.
Post Comment Notify me of follow-up comments by email. Notify me of new posts by email.
LATEST
9 f 10
ICSE 2014 Computer Applications Paper Solved
(http://www.guideforschool.com/1
© www.guideforschool.com | Designed By -
15 02 2015 19 41
Advice on How to write Algorithm in ISC Computer Practical | Guide ...
http://www.guideforschool.com/1611744-advice-on-how-to-write-algor... Follow
������
(http://www.guideforschool. )
����� ��� ������
In this section we will be
In this section we will be
In this section we will be
providing you with the previous
providing you with the previous
providing
years question papers of ISC
years question papers of ICSE
Sample/Guess papers of ICSE
Computer Science which can
Computer
which
(Computer Applications) and
be easily downloaded.
We
can be easily downloaded. We
ISC (Computer Science) which
hope that the students will
hope that the students will
can be easily downloaded. We
benefit from these resources.
benefit from these resources.
hope that the students will
Visit This Section
Visit This Section
(http://www.guideforschool.com
(http://www.guideforschool.com
Class 10
/class-12-isc-computer-science
/class-10-icse-computer-
(http://www.guideforschool.com
/download-isc-computer-
application/download-
/class-10-icse-computer-
science-previous-years-
icse-computer-applications-
application/icse-sample-
question-papers/)
previous-years-question-
papers-computer-applications/)
papers/)
| Class 12
Application
you
with
the
���
��������������� ���� ������� �� ����� ��� ����� ���������� ������ �����������������
����� �� ���������������
benefit from these resources.
(http://www.guideforschool.com /class-12-isc-computer-science /isc-sample-papers-computerscience/)
LATEST
10 f 10
ICSE 2014 Computer Applications Paper Solved
(http://www.guideforschool.com/1
© www.guideforschool.com | Designed By -
15 02 2015 19 41