Graderpractice for programmers

254271 Fun (2562 Sec 1&2) - Mini Test 1

Awaiting submission
Read in two integers that represent a vector (x, y) in a 2D space. Print out the quadrant number where the point is.

The 4 quadrants of a 2D space are:

Point P is in Quadrant II.

The input vector will always have exactly 1 quadrant. Ignore the case of points that are along the axis (e.g. 0,y and x,0 are not valid inputs).

Awaiting submission
Read in two real numbers (type double). Print out every integer in between (exclusive) in ascending order.

Hint: you can use Math.floor(1.23) to get 1.0 and Math.ceil(1.23) to get 2.0.

Awaiting submission
Read in 3 positive integers. The first number is the size of the quadrant (grid). The second and third numbers are a point (x,y) in the quadrant. Print out the quadrant (a square of dots) where X marks the point.

Awaiting submission
Write a program that adds two vectors of any dimension d.

The first line of the input contains the integer d. The remaining d lines each contain 2 integers, the first column is vector 1 and the second column is vector 2.

The output contains vector 1, vector 2 and the result of adding the vectors. The + and = should be on the last line of the output.