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

Pseudocode and flow chart for the problem of Printing odd numbers less than a given number it should also calculate their sum and count

In plane geometry, the x- and y axis of a 2D Cartesian system divide it into four infinite regions called quadrants. Your task is to model each point with an x-value and y-value. Apart from the constructors, getters, and setters, implement a getQuadrant method to determine the region in which a given point falls.

  

    Sample Run1                                                           Sample Run2

        Enter the x and y value: 5 8                                          Enter the x and y value: 7 -3

       Output1: Point (5,8) is in Quadrant I                       Output2: Point (7,-3) is in Quadrant IV

Create a project to model students with firstname, lastname, age, gender and student number. Create two constructors, one to be used as default and another to include all attributes. Add a class attribute to keep count of all registered students. Use the class attribute to generate student numbers with the following format 22201XYZ, where XYZ is the current count provided by the class attribute. Implement the respective getters and setters for each attribute. Now given a list of student information create the respective objects and print out their details see samples below, make sure the student class has a toString method.


Sample Run1



2



John Doe 29 M



Kelly Daniela 40 F



Output1:



Full names : John Doe



Age : 29



Gender : M



Student Number : 22201001

a square matrix A of dimensions NxN. You need to apply the below given 3 operations on matrix A.

Rotation: It represented as R S where S is integer in {90, 180, 270, 360, 450, .} which denotes the number of degrees to rotate. You need to rotate matrix A by angle S in the clockwise angle of rotation(S) will always be in multiples of 90 degrees.

Update: It is represented as U X Y Z. In initial matrix A (as given in input), you need to update the element at row index X and column index Y with value Z.

After the update, all the previous rotation operations have to be applied to the updated initial matrix.

Query: It is represented as Q K L. need to print the value at row index K and column index L of the matrix A.

Next N lines contain N space-separated integers Aij (i - index row, j - index of column)


-1 will represent the end of input.




S Input:


2

5 6

7 8

R 90

Q 0 1

R 270

Q 1 1

R 180

U 0 0 4

Q 0 0

-1

op:

5

8

8












Your younger brother is studying in school. His computer teacher gives homework to make a calculator for six operations: addition, subtraction, multiplication, division, power, and modulo on two integers. As you are about to become an engineer, so he expected help from your side to develop the program. Therefore, write Calc.py module that define a separate function for implementing all the above-mentioned operations. Then import Calc.py in your RollNo_W12A_1.py file. In RollNo_W12A_1.py, define a function Arithmatic(a, b, op)  which calls the respected function defined in Calc.py to perform the required operation. Also handle the possible exceptions and display the exception message in form of string


Friend and Enemy


A group of F friends went to a haunted house.Each member was given a shirt with a number on it ranging from 1 to F. As they entered the haunted house, one of them was kidnapped and an enemy joined them.But unfortunately, the enemy didn't wear the shirt with the same number as the kidnapped one, instead wore the same as some other person.Find the numbers on the shirts of the enemy and the kidnapped person.


Input

The input is a single line containing space-separated positive integers from 1 to F.


Output

The output should be a single line containing the shirt numbers of the enemy and kidnapped person separated by a space.


Explanation

The given array is 3 1 5 2 1.

In the range from 1 to 5, the number 1 has occured twice and 4 is the missing number. So, 1 belongs to the enemy's shirt, and 4 belongs to kidnapped.Hence, the output should be 1 4.


Sample Input1

3 1 5 2 1

Sample Output1

1 4


Sample Input2

1 2 2 4

Sample Output2

2 3



1. Create a project to model student with firstname, lastname, age, gender and student number. Create two construtors, one to be used as default and another to include all attributes. Add a class attribute to keep count of all registered students. Use the class attribute to generate student numbers with the following format 22201XYZ, where XYZ is the current count provided by the class attribute. Implement the respective getters and setters for each attribute. Now given an list of student information create the respective objects and print out their details see samples below, make sure the student class has a toString method. Sample Run1 2 John Doe 29 M Kelly Daniela 40 F Output1: Full names : John Doe Age : 29 Gender : M Student Number : 22201001 Full names : Kelly Daniela Age : 40 Gender : F Student Number : 22201002


Sum of Non-Diagonals

As the creative content member of your newspaper company, you are given the task to publish a puzzle in your local newspaper. For a given MxM integer matrix, the task is to print the sum of all elements other than the diagonal elements,Both the diagonals are to be excluded.


Input

The first line of input is a positive integer M.

The next M lines of input contain M space-separated integers.


Output

The output is an integer that represents the sum of all the numbers in the matrix as mentioned above.


Sample Input1

3

4 1 3

2 5 6

1 2 3

Sample Output1

11


Sample Input2

5

1 2 2 3 3

4 4 5 6 7

9 8 7 6 5

9 2 3 8 8

-4 -2 -2 4 -7

Sample Output2

63


Create a project to model student with firstname, lastname, age, gender and student number. Create two construtors, one to be used as default and another to include all attributes. Add a class attribute to keep count of all registered students. Use the class attribute to generate student numbers with the following format 22201XYZ, where XYZ is the current count provided by the class attribute. Implement the respective getters and setters for each attribute. Now given an list of student information create the respective objects and print out their details see samples below, make sure the student class has a toString method. Sample Run1 2 John Doe 29 M Kelly Daniela 40 F Output1: Full names : John Doe Age : 29 Gender : M Student Number : 22201001 Full names : Kelly Daniela Age : 40 Gender : F Student Number : 22201002


 There are N intermediate stations between two places A and B. Find the number of ways in which a train can be made to stop at S number of these intermediate stations so that no two stopping stations are consecutive. Write a python module Station.py for above and import the module , define a function Get_Stations(N, S) which takes value of N & S and return integer result as shown in example by calling the appropriate function implemented in Station.py module. Also handle the possible exceptions and display the exception message in form of string.


Example-1

Example-2

Example-3

Input:

12

4

 

Output:

126

Input:

16

5

 

Output:

792

Input:

2

4

 

Output:

No Station



LATEST TUTORIALS
APPROVED BY CLIENTS