View the step-by-step solution to:

MIS 515- Spring 2013 Objective-C programming Assignment #2. Objectives: User-defined classes. If-else, while and other control structures. Separate...

can you guys do a small objective -C project use xcode?

MIS 515- Spring 2013 Objective-C programming Assignment #2. Objectives: User-defined classes. If-else, while and other control structures. Separate interface and implementation files This is an extension of program 1, with extra control features and use of strings Write a Objective-C project to define a class for a simplified bank account and the program to test it (main function). The project will consist of 3 separate files as per Chapter 7: the interface file, the implementation file, and the main() function. At the minimum, the Account class will include the following elements instance variables, using @property and @synthesize account number Customer last name, first Name (see remark below about Objective-C strings) Extra-credit beginning balance end balance total withdrawal total deposit Feel free to add extra instance variables that are needed. Methods : Usual setter methods; getter methods defined with @property and @synthesize addDeposit(amount) method: add deposit to the balance subtractWithdrawa(amount): subtract withdrawal from balance print : display the values of the instance variableslisted above. If the balance is negative, will display a message indicating that account is overdrawn. The main function will read the data for customers (except last name, first name) and invoke the needed methods. We will assume four Accounts (4 objects declared in the test program). The program will also read transactions (deposits or withdrawals) for the month Account number: 10000 Customer Last name, First Name: Norbert, Pat ( to be hard-coded, input is very complex) Data type: an object of class NSString, (see below about strings) Beginning balance 900 Transactions (must be entered in the order shown) (1 for Deposit, -1 for withdrawal, 0 for end of transaction for current account) 1 250 1 200 -1 150 -1 100 -1 300 0 Account number: 20000 Customer Last name, First Name: Lopez, Andy Beginning balance 700 Transactions: -1 750 0 Note: this account will be overdrawn Account number: 30000 Customer Last name, First Name: Pham, Debby Beginning balance 900
Background image of page 1
Transactions: -1 50 1 20 -1 150 1 20 0 Account number: 40000 Customer Last name, First Name: Crown, Renee Beginning balance 300 Transactions: 0 (no transactions) ************************************************************************************************** Explanations End of transactions for each account will be indicated by the code 0. Main function structure 1. An outer loop (For-Loop). The code inside the outer loop is executed 4 times, once for each account 2. An inner loop (a while-loop nested in the for-loop). This while loop reads the transactions for an account and performs the appropriate processing needed for the account The following is a skeleton of the code for main function., You need to fill-in where needed and make sure the syntax works int transactionCode; Account *acct, *acct1, *acct2, *acct3, *acct4; for (i =1; ……………) { prompt for and read account number; Create Account object, using acct as reference variable to the object Hard code lastname, firstname prompt to read beginning balance- set beginning balance in account Prompt for transaction Read transactionCode While (transactionCode. != 0) { test transaction code and process transaction That is compute accrued withdrawals, deposits Read transaction code } //end while loop Compute, set the fields totalDeposit, totalWithdrawals, , endBalance in the Account object referred to by acct; Test i (the for-loop control variable) and “saves” the reference to the current Account object. For example: If(i==1) acct1 = acct;
Background image of page 2
Show entire document
Sign up to view the entire interaction

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.


Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question