• Save
oop Lecture 9
Upcoming SlideShare
Loading in...5
×
 

oop Lecture 9

on

  • 240 views

 

Statistics

Views

Total Views
240
Slideshare-icon Views on SlideShare
240
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    oop Lecture 9 oop Lecture 9 Document Transcript

    • Object Oriented Programming – Spring 2011 Engr. Anwar, Foundation University (FUIEMS), Islamabad Quiz 1 [10 Marks] Time allowed: 20 MinutesQuestion: Create a class called Time. The purpose of this class is to print time in two different formatsmilitary format and standard format.Example of military format is: 13: 27 (13 being hour and 27 being minutes)Example of standard format is: 1: 27:06 PM (1 being hour, 27 being minutes and 06 being seconds)Your class should have at least 3 integer type attributes: 1. Hour 2. Minutes 3. SecondsAnd 4 methods (behavior) 1. Time (Constructor Function) 2. setTime 3. printMilitary 4. printStandardThe input to program is optional i.e. it can be from user or already specified in your program. Youprogram should handle all wrong input conditions. Explain your program.