Uploaded by Manpreet Kaur

PROG10082 A-1

advertisement
PROG 10082, Object Oriented Prog 1
Assignment #1
2% of your course mark
Due Dates: Thursday Sept 16 , Submit on Slate , Late submission is -10% per day
for 3 days.
Assignment Submission
1. This assignment is an individual work (MUST meet and comply with Sheridan’s rules on
academic integrity).
2. Submit your assignment using SLATE (you must submit the program regardless whether
it is complete or incomplete, correct or incorrect)
3. Attach and upload the source code file (.java) for your program. Also, you should
submit your report as .pdf
4. Do not use ZIP or RAR.
If you have questions about this assignment, please ask me in class.
1. [5 marks] Write a Java application that displays the following information about yourself on
the console (i.e. not using dialogs):
i.
ii.
iii.
Your first and last name
Your previous programming experience (how long? what language(s)?)
Your favourite subject in high school (or university, or wherever you were before this)
Below is an example that shows the format of your program's output:
Name: Alex McDonald
Programming Experience: none, but my hobby is to learn how to code
Favourite Subject: Computer , Biology, Science
Interests: watching movies, playing games
2. [3 marks] Show the output of the following code:
public class Test {
public static void main(String[] args) {
System.out.println("3.5 * 4 / 2 - 2.5 is ");
System.out.println(“*********************”);
System.out.println(3.5 * 4 / 2 - 2.5);
}
}
3. [2 marks] Identify and fix the errors in the following code:
1
2
3
4
5
public class Welcome {
public void Main(String[] args) {
System.out.println('Welcome to Java!');
}
)
Answer:
Line :
Line :
Line :
Line :
Download