Object Oriented Programming (Swe-103) Lab Exam: Stock Symbol Name Double Previousclosingprice Double Currentprice
Object Oriented Programming (Swe-103) Lab Exam: Stock Symbol Name Double Previousclosingprice Double Currentprice
Lab Exam
Instructions:
• Attempt 2 questions where Question 7 is compulsory.
• The formula for getting next question is (Rollno%6)+1 or (Rollno
mod 6)+1 for example 123%6=3+1 (Attempt Question No 4)
126%6=0+1( Attempt Question No 1)
Question 1:
Question 3:
Write a program that prompts the user to enter the length in feet and inches
and outputs the equivalent length in inches and in centimeters. If the user
enters a negative number or a nondigit number, throw and handle an
appropriate exception and display the message
Question 4:
Create an abstract Auto class with fields for the car make and price. Include
get and set methods for these fields; the setPrice() method is abstract.
Create two subclasses for individual automobile makers (for example,
Ford or Chevy), and include appropriate setPrice() methods in each
subclass (for example, $20,000 or $22,000). Finally, write an application
that uses the Auto class and subclasses to display information about
different cars.
Question 7(Compulsory)
Write a program that prompts the user to enter the length in feet and inches
and outputs the equivalent length in inches and in centimeters. If the user
enters a negative number or a nondigit number, throw and handle an
appropriate exception and display the message