home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.bin / SourceCode / OOP_Course / Labs / Converter / Converter.m < prev    next >
Encoding:
Text File  |  1993-01-18  |  479 b   |  30 lines

  1.  
  2. #import "Converter.h"
  3.  
  4. @implementation Converter
  5.  
  6. - convert:sender
  7. {
  8.     if(convertingTemp) [output setFloatValue:(1.8*[input floatValue]+32.)];
  9.     else [output setFloatValue:(2.2*[input floatValue])];
  10.     return self;
  11. }
  12.  
  13. - selectWt:sender
  14. {
  15.     [inputLabel setStringValue:"Kgs"];
  16.     [outputLabel setStringValue:"Lbs"];
  17.     convertingTemp=NO;
  18.     return self;
  19. }
  20.  
  21. - selectTemp:sender
  22. {
  23.     [inputLabel setStringValue:"C"];
  24.     [outputLabel setStringValue:"F"];
  25.     convertingTemp=YES;
  26.     return self;
  27. }
  28.  
  29. @end
  30.