Week 12 Programming Assignment 1
A box is placed at an orientation on the (0,0,0) point. Given other 3 points which are the endpoints. Find the volume of the box.
line 1 - Point 1 coordinates
line 2 - Point 2 coordinates
line 3 - Point 3 coordinates
Output format:
Volume of the box
Example:
Input
2 2 -1
1 3 0
-1 1 4
Output
12
Week 12 Programming Assignment 2
Ramesh and Suresh have written GATE this year. They were not prepared for the exam. There were only multiple choice questions. There were 5 options for each question listed 1,2,3,4,5. There was only one valid answer. Each question carries 1 mark and no negative mark. Ramesh and Suresh are so sure that there is no question that both of them have answered correctly, i.e, one of them has given invalid answer.
Now Ramesh wants to know how well he has done the GATE. Given the answers of both Ramesh and Suresh, You should tell me what the maximum marks that Ramesh can get.
Input Format:
Line1 - Number of Questions in the GATE Exam
Line2 - List of Answers given by Ramesh(Answer no given then its represented by ‘.’)
Line3 - List of Answers given by Suresh (Answer no given then its represented by ‘.’)
Output Format:
Maximum score for Ramesh
Input:
6
1 2 3 4 5 1
1 2 2 2 5 1
Output
2
Week 12 Programming Assignment 3
Consider a triangle PQR, ∡PQR is 90o . X is the midpoint of the line PR. Given the input the lengths of PQ and QR find the angle ∡XQR.
Input Format:
Line 1 - Length of side PQ
Line 2 - Length of side PR
Output Format:
angle ∡XQR in degrees. Round to the nearest integer.
Example:
Input
10
10
Output
45