Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Question 1

Part 1: Conditional Logic

Conditional logic is used within your application to make decisions during the application lifetime. Objective-C is quite typical of other languages in the syntax and structure of conditional logic, though things get more complicated when attempting to determine if two NSObject-based objects are equal. The main syntax elements you have available are the if statement, the switch statement, and the question mark ? known as the ternary operator in the C programming language.

Create a new project in XCode using the Mac OS X/Command Line Tool template.

Use at least one case of each of the following:

if statement using the == operator
if statement using the is Equal To: method
compound logic, using and (&&) or using or (||)
Perform a logical test to see if something is not true.

Part 2: Methods and Parameters

Methods are functions that are defined on a class in order for that class to perform tasks. Often, those tasks involve ivars and properties of the object, and sometimes those tasks require extra information to complete the task properly. This extra information can be passed to the method through parameters.

Create a new project in XCode using the Mac OS X/Command Line Tool template. You can use the same project as you created in the first part of this assignment. Create a custom class that contains at least three public methods and one private method. From the main() method in main.m, create an instance of the class and demonstrate calling the methods.

At the Apple developer site, track down the official Objective-C documentation. Review the section on properties. The Objective-C Programming Language

Question 2 : Complete all parts

Part 1: A Date class

Design a class called Date. The class should store a date in three integers: month, day, and year. There should be member functions to print the date in the following forms:
12/25/2012
December 25, 2012
25 December 2012

Perform the following input validation: Do not accept values for the day greater than 31 or less than 1. Do not accept values for the month greater than 12 or less than 1.

Part 2: A PayRoll class

Design a PayRoll class that has data members for an employee's hourly pay rate, number of hours worked and total pay for the week. Write a program with an array of seven PayRoll objects. The program should ask the user for the number of hours each employee has worked and will then display the amount of gross pay each has earned.
Perform the following input validation: Do not accept values greater than 60 for the number of hours worked.

Part 3: DayOfYear class

Assuming that a year has 365 days, write a class named DayOfYear that takes an integer representing a day of the year and translates it to a string consisting of the month followed by day of the month. For example,

Day 2 would be January 2
Day 32 would be February 1
Day 365 would be December 31

The initializer for the class should take as parameter an integer representing the day of the year, and the class should have a member function print() that prints the day in the month-day format. Test your class by inputting various integers representing days and printing out their representation in the month-day format.

Demonstrate the functionality of all of these classes in one or more driver programs.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9131345
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Programming Language

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As