Design and Implementation of Electronic coupons for ios development

Source: Internet
Author: User

Design and Implementation of Electronic coupons for ios development

/// Main. m // electronic coupon // # import
 
  
# Import Discount. h # import Food. hint main (int argc, const char * argv []) {Discount * dis = [[Discount alloc] init]; [dis showInformation: 20 andDiscountTime: @ This coupon uses andContentInformation after every day: @ This coupon is only available for McDonald's restaurants that sell coupon products in mainland China. This coupon is only available in the public shop and is valid from January 1, December 4-20, 2013 to January 1, December 30; invalid alteration or damage; food is subject to the actual product, and images are for reference only; this coupon is not suitable for food delivery services; other items (including containers) except food are not available for sale; this coupon cannot be used together with other promotions]; @ autoreleasepool {// insert code here... NSLog (@ Hello, Worl D !); } Return 0 ;}
 
/// Discount. h // electronic coupon // # import
 
  
@ Interface Discount: NSObject {/** used to record the Discount price */int _ price;/** used to record the Discount time */NSString * _ discountTime; /** final interpretation right information */NSString * _ contentInformation;} @ property int price; @ property NSString * discountTime; @ property NSString * contentInformation;-(void) showInformation :( int) price andDiscountTime :( NSString *) discountTime andContentInformation :( NSString *) contentInformation; @ end
 

//// Discount. m // electronic coupon // # import Discount. h @ implementation Discount @ synthesize price = _ price; @ synthesize discountTime = _ discountTime; @ synthesize contentInformation = _ contentInformation;-(void) showInformation :( int) price andDiscountTime :( NSString *) discountTime andContentInformation :( NSString *) contentInformation {_ price = price; _ discountTime = discountTime; _ contentInformation = contentInformation; NSLog (@ price: % d discount time: % @ details: % @, _ price, _ discountTime, _ contentInformation);}-(NSString *) description {return [NSString stringWithFormat: @ price: % d discount time: % @ details % @, _ price, _ discountTime, _ contentInformation];} @ end
/// Food. h // electronic coupon // # import
 
  
@ Interface Food: NSObject {/** is used to record the Dish name */NSString * _ foodName;/** composition material */NSString * _ material; /** nutrition information */NSString * _ nutrition;/** used to record the food type */NSString * _ kindOfFood;} @ property NSString * foodName; @ property NSString * material; @ property NSString * nutrition; @ property NSString * kindOfFood;-(void) showInformation :( NSString *) foodName andShowMaterial :( NSString *) material andShowNurition :( NSString *) nutrition; @ end
 

//// Food. m // electronic coupon // # import Food. h @ implementation Food @ synthesize foodName = _ foodName; @ synthesize material = _ material; @ synthesize nutrition = _ nutrition; @ synthesize kindOfFood = _ kindOfFood;-(void) showInformation :( NSString *) foodName andShowMaterial :( NSString *) material andShowNurition :( NSString *) nutrition; {_ foodName = foodName; _ material = material; _ nutrition = nutrition; NSLog (@ % @, _ foodName, _ material, _ nutrition);}-(NSString *) description {return [NSString stringWithFormat: @ food name: % @ ingredients: % @ nutrients: % @, _ foodName, _ material, _ nutrition];} @ end


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.