Design and implementation of cinema (improved update)

Source: Internet
Author: User

The previous cinema ticketing system has been improved to encapsulate the data as it should be, ensuring the security of the data.

To provide users with only the use of the interface

  design and implementation of main.m//Cinema//#import <Foundation/Foundation.h> #import "Cinema.h" int main (int argc, const char * argv[]) {    @autoreleasepool {                //1. Create Object        cinema * Cinema = [[Cinema new]init];        2. Print the video message        [Cinema movieinformation];        3. The user chooses the movie        [Cinema Selectmovie];        4. The user chooses automatic arranging        [cinema selectrownumber];        5. The user chooses the seat        [cinema Selectseatnumber];        6. Print the ticket        [cinema printTicket];             }    return 0;}

////cinema.h//Cinema Design and implementation//#import <Foundation/Foundation.h> @interface Cinema: nsobject{int _movienumber;//movie number int _rownumber;//automatic arranging int _seatnumber;//seat number}//See video-(void) movieinformation;//Select Movie-( void) selectmovie;//Select Automatic Arranging-(void) selectrownumber;//Select seat number-(void) selectseatnumber;//ticket-(void) printTicket; @end 
  design and implementation of cinema.m//Cinema//#import "Cinema.h" @implementation cinema//-(void) movieinformation{    NSLog (@ "title:%@\n Release Date:%@\n Movie Duration:%@\n Actor:%@\n Director:%@\n film Number:%@", @ "no Man's Land", @ "December 24, 2013", @ "116 minutes", @ "Andy Lau, Huang Ye", @ "Zhang Yimou", @ "1");} Select Movie-(void) selectmovie{    //1. Prompt user to enter    NSLog (@ "--Please select Movie--");    int movienumber = 0;    scanf ("%d", &movienumber);    2. Record user input information    _movienumber = Movienumber;} Select Automatic arranging-(void) selectrownumber{    NSLog (@ "Total 10 rows, no row 20 seats");    1. Prompt the user to select Automatic arranging    NSLog (@ "--Please select automatic arranging--"); int rowNumber = 0; scanf ("%d", &rownumber);    2. Record user input information    _rownumber = RowNumber;} Select seat number-(void) selectseatnumber{    //1. Prompt with the seat number selected    NSLog (@ "-Please select seat number--");    int seatnumber = 0;    scanf ("%d", &seatnumber);    2. Record user input information    _seatnumber = Seatnumber;} Ticket-(void) printticket{    NSLog (@ "Movie:%d%d rows%d", _movienumber,_rownumber,_seatnumber);} @end



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

Design and implementation of cinema (improved update)

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.