Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Rotate Matrix Rings

Given a matrix of order M*N and a value K, write a program to rotate each ring of the matrix clockwise by K elements. If in any ring has less than or equal to K elements, then don’t rotate that ring.Input


For example, if the given M and N are 4 and 4 respectively. If the matrix elements are

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

If the given K is 3. Rotate each ring of the matrix by 3 elements.

In the above matrix, the elements (1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5) is a ring, similarly, the elements (6, 7, 11, 10) will make a ring.

Therefore, by rotating each ring in clockwise direction by 3 elements will give (13, 9, 5, 1, 2, 3, 4, 8, 12, 16, 15, 14) and (10, 6, 7, 11). So the output should be

13 9 5 1

14 7 11 2

15 6 10 3

16 12 8 4


Sample Input

3 4

1 2 3 4

10 11 12 5

9 8 7 6

2


Sample Output

9 10 1 2

8 11 12 3

7 6 5 4




Write a program that will arrange the elements of a 10 integer array in descending order.


  1. Present an overview of QPI.

Discuss the relative advantages of point-to-point interconnection compared to bus interconnection


Write a program using constructor overloading to implement the following tasks:

1.Print sides of a cube


2.Print radius and height of the cylinder


3.Calculate the volume of a cube


4.Calculate thevolume of a cylinder



Write a program to find a maximum number between/among two and three numbers using constructor

overloading



1.      >>> 2- 2



2.      >>> 2 -(2-)

 File "<stdin>", line 1

   2 -(2-)

         ^

SyntaxError: invalid syntax


3.      >>> (0+1)-9(1/2)

<stdin>:1: SyntaxWarning: 'int' object is not callable; perhaps you missed a comma?

Traceback (most recent call last):

 File "<stdin>", line 1, in <module>

TypeError: 'int' object is not callable


Give explanation to these results experimented in python above.

Write a program in C++ to open and read the contents of the Text1.txt using the file stream class. 

Close the file and again open to update the contents of given file Text1.txt.

Text1.txt : I am enjoying learning OOPS concepts

After update 

Text1.txt: I am enjoying learning OOPS concepts

 Now learnt C++; Java is my next target.


Write a program in C++ to accept date in dd:mm:yyyy format. Store these values in MyDate Class 

with members as day, month and year. Convert this date into one variable “Duration” of the current 

years. This duration means number of days passed in the current year since Jan 1. 

Hint :Use type conversion method from class type to basic type conversions. 

Note: consider days in February as 28 for all years.

Output expected:

Enter Date : 05:04:2021

No of days since Jan 1 of the current year : 90


Write a python program to achieve Advanced Encryption Standard 128 bit key length encoding and decoding of text.

Program should be algorithm based rather than using any library function. Write both ENCODING and DECODING.  

Input text

“To be, or not to be, that is the question: Whether 'tis nobler in the mind to suffer

The slings and arrows of outrageous fortune,

Or to take arms against a sea of troubles

And by opposing end them. To die—to sleep,

No more; and by a sleep to say we end

The heart-ache and the thousand natural shocks

That flesh is heir to: 'tis a consummation

Devoutly to be wish'd. To die, to sleep;

To sleep, perchance to dream—ay, there's the rub:

For in that sleep of death what dreams may come,

When we have shuffled off this mortal coil,

Must give us pause—there's the respect

That makes calamity of so long life.

When he himself might his quietus make

With this regard their currents turn awry

And lose the name of action.”




LATEST TUTORIALS
APPROVED BY CLIENTS