Subscribe to Blog via Email

Question:

Write a program to declare a square matrix A[ ][ ] of order MxM where ‘M’ is the number of rows and the number of columns, such that M must be greater than 2 and less than 10. Accept the value of M as user input. Display an appropriate message for an invalid input. Allow the user to input integers into this matrix. Perform the following tasks:

Sir, your code rocks! Only now I realize I wasted effort and paper in separating the rotation part into two separate nested loops.
But what I wished to ask you is if it is absolutely necessary to use ” throws Exception ” while using the Scanner class. I assume since it compiles without that statement, teachers do not mention its importance. Still I ask, in reference to what is expected in Paper-1.

Sir I attempted this question and I managed to run the program in one go without any errors which I had written in my paper…but sir regarding the sum of the corner elements the coding which I had written was only for m=3 so I made some slight changes in the program while typing…after this my program was 100% perfect and even my viva was perfect…so sir this change will affect my marks…I’m a bit tensed..sir visiting examiner appreciated my program as it was of shortest length…sir can u also tell me how the ultimate marks in the isc are given…sir I want to thank u bcoz this site helped me a lot while preparing for the practical exam even it will help in my theory…

Sir, i attempted this question today. but i did not save the values of the rotated matrix in another array. all i did was use two for loops to simply print the rotated matrix. used to variables i and j. initial value of i was 0, final value was i=0 and decremented by 1. and finally printed it by System.out.print(matrix[j][i]+ ” “); . It worked perfectly. Am i good to go or was it necessary to store the numbers in another matrix?

Sir, u did not reply whether the code given by me was correct or not…am writing it once more…
the main 90 degree reversing loop…
for(int i=0;i<M;i++)
{
for(int j=0;j<M;j++)
{
B[j][M-1-i]=A[i][j];
}//end of j
}//end of i
Here A is the original matrix and B is the rotated matrix….

Sir,I have attempted this program and I got the output in one try..but later I found that at two places,I have written another variable ‘n’ instead of ‘M’ by mistake…I have corrected it in the printout portion as well as in the code written on the computer..will any marks be deducted for this?? And I also want to thank you for providing many viva questions which helped in the exam.

Sir, I attempted this particular question and written the code absolutely perfect. The algorithm too was correct. Even the viva went very well. The examiner complemented me even. But in the end, (as we do come to know about our marks from the school itself), I got the news that no one in our batch scored 95 even. It struck pretty much as a shock to us, as we are used to getting 98-99 even in the harder school semester examinations. My question is where could the possible deduction happen? And is there any way this marks can increase a bit afterwards?
Kind Regards,

sir i made slight changes in the program which i typed on the computer compared to the answer which i wrote on the answer sheet and i printed the sum of boundry elements instead of corner elements…how many marks will be deducted.

Sir,i compiled this program and successfully got my output during my board practical but i forgot to write “import java.io.*” in the answer sheet.How many marks would be cancelled for this thing.Reply soon
I must say “GUIDE FOR SCHOOL” is best for ISC students.It helped me a lot

ICSE | ISC Sample Papers

In this section we will be providing you with the Sample/Guess papers of ICSE (Computer Applications) and ISC (Computer Science) which can be easily downloaded. We hope that the students will benefit from these resources.