Design and implementation of electronic coupon for iOS development

Source: Internet
Author: User

  main.m//  E-coupon//#import <Foundation/Foundation.h> #import "Discount.h" #import "Food.h" int main ( int argc, const char * argv[]) {    Discount * dis = [[Discount alloc]init];        [Dis showinformation:20 anddiscounttime:@] This coupon is used after 10:30 daily to use the "andcontentinformation:@" coupon only for McDonald's restaurants selling coupon products in mainland China , the specific notice in the store, the validity of December 4, 2013-December 30, 2013, alteration or damage is invalid; Food in kind, the image for reference only; this coupon is not suitable for room service; except food, other items (including containers) are not covered by the sale This coupon cannot be used in conjunction with other promotional offers.        @autoreleasepool {                //Insert code        here ... NSLog (@ "Hello, world!");            }    return 0;}
  discount.h//  E-coupon//#import <Foundation/Foundation.h> @interface discount:nsobject{    /** Used to record discounted price */    int _price;        /** used to record the time of discounted use * *    NSString * _discounttime;        /** Final Interpretation Rights 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//e-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:%@ Detailed Description:%@", _price,_discounttime,_contentinformation);} -(NSString *) description{return [NSString stringwithformat:@ "Price:%d discount time:%@ details%@", _price,_discounttime,_ Contentinformation];} @end 
  food.h//  E-coupon//#import <Foundation/Foundation.h> @interface food:nsobject{    /** to record the name of the dish * *    NSString * _FOODNAME;        /** Composition Material    */NSString * _material;        /** Nutrition Information    * * NSString * _nutrition;        /** used to record food types * *    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//  E-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



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Design and implementation of electronic coupon for iOS development

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.