View the step-by-step solution to:

# ASSIGNMENT 1 COMP-202B, Winter 2013, All Sections Due: Monday, January 28, 2013 (23: Graders have the discretion to impose penalties to students who...

ASSIGNMENT 1 COMP-202B, Winter 2013, All Sections Due: Monday, January 28, 2013 (23:55) You MUST do this assignment individually and, unless otherwise speciﬁed, you MUST follow all the general instructions and regulations for assignments. Graders have the discretion to impose penalties to students who deviate from the general instructions and regulations; these penalties will take the form of deductions from the marks allocated for respect of instruc- tions and regulations. Part 1, Question 1, 2, 3: 0 points Part 2, Question 1: 30 points Part 2, Question 2: 50 points Part 2, Question 3: 20 points 100 points total Part 1 (0 points) Do NOT hand in this part, as it will not be graded. However, doing this exercise might help you to do the second part of the assignment (that will be graded). If you have diﬃculties with the questions of Part 1, then we suggest you go to one of the oﬃce hours; the TA can help you and work with you through the warm-up questions. Warm-up Question 1 (0 points) Create a ﬁle called HelloWorld.java , and in this ﬁle, declare a class called HelloWorld . This class should deﬁne only one method called main() . In the body of this method, use System.out.println() to display “ Hello world! ”. You can ﬁnd such a class in the lecture slides; make sure you can compile and run it properly. Warm-up Question 2 (0 points) Consider the following 2-d matrix: ± a b c d ² Write a Java program that ﬁrst reads 4 doubles, representing a,b,c, and d from the keyboard. It then outputs to the screen the determinant of the matrix. For a 2x2 matrix, the determinant is always equal to a * d - b * c Warm-up Question 3 (0 points) Suppose you know Merlin, an all-powerful wizard who provides you with the following curious method for multiplying any two numbers between 100 and 109: 1. The most signiﬁcant digit will always be 1. 2. The next two signiﬁcant digits will be the summation of the least signiﬁcant digits of the the inputs. 3. The ﬁnal two digits will be the product of the least signiﬁcant digits of the inputs. 1
Show entire document

PFA attached... View the full answer

computerscience_8422649.rar - Preview not available

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents