Assignment No. 04
Semester: Fall 2013
Modern Programming Languages (CS508)
Total Marks: 10
Due Date: 03/02/2014Instructions:
Please read the following instructions carefully before submitting assignment:
You will submit your assignment before or on due date on VU-LMS.
Assignment should be completed by your own efforts it should not be copied from internet, handouts or books.
You should submit your MS Word File via assignment interface at VU-LMS. (Both code and screenshot)
Assignment sent via Email will not be replied and accepted/graded in any case.
If the submitted assignment does not open or file is corrupt, it will not be graded.
You will submit solution only in Microsoft Word File.
Objectives:
To understand the basics of Java language & exception handling in Java.
For any query about the assignment, contact at cs508@vu.edu.pk or through MDB.
Assignment Questions
Question # 1 Marks 15
You will write a simple JAVA program that will take input from user, After taking input in try block it will check it if it is your VU id. If it is your VU-ID it will display message “Yes it is my VU-ID” else it will raise an exception MyException, in catch block you will catch the myException.
Note you will not write anything in the catch block.
You will write a simple class MyException, this class will extend the exception class and it will display the message, You will write the method public MyException (), to display the following message.
This is not my VU-ID
My VU-ID is bc123456789 (Note you will display your VU-ID here )
In case if you will write your correct VU-ID
Note :
BEST OF LUCK







0 comments:
Post a Comment