Question 1part 1 conditional logicconditional logic is used

Assignment Help Application Programming
Reference no: EM13346990

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.

Reference no: EM13346990

Questions Cloud

Capmstock s has a volatility s 14 and the covariance of : capmstock s has a volatility s 14 and the covariance of its return with the return of the market portfolio is sm
Telephone calls arrive at the information desk of a large : telephone calls arrive at the information desk of a large computer software company at a rate of 15 per hour.a what is
Managing ashland multicomm services1 hint let pi 002 as : managing ashland multicomm services1. hint let pi 0.02 as shown in the table for no free premium channels.a. px lt 3
Adsorption and membrane processeszeolites are used to : adsorption and membrane processeszeolites are used to adsorb a wide range of solutes from vapour and gas streams. what
Question 1part 1 conditional logicconditional logic is used : question 1part 1 conditional logicconditional logic is used within your application to make decisions during the
Question 1 turkish air is expected to pay a 200 dividend at : question 1 turkish air is expected to pay a 2.00 dividend at the end of this year. if you expect turkish airs dividend
Question 1let a be a 4x4 matrix composed of all 0slet b be : question 1let a be a 4x4 matrix composed of all 0s.let b be a 4x4 matrix composed of all 1s. 1. a nand b all
Question 1write the selection sort algorithm as a template : question 1write the selection sort algorithm as a template function using the less than operator to compare two
Create a very simple order system as a web application the : create a very simple order system as a web application. the application allows users to view the order and products

Reviews

Write a Review

Application Programming Questions & Answers

  In this project you will create an application to run in

in this project you will create an application to run in the amazon ec2 service and you will also create a client that

  Imagine that your company has decided to expand to the web

imagine that your company has decided to expand to the web. you want to reuse some data entry code that has been

  1 here is a short program it prints out the value of a

1. here is a short program. it prints out the value of a variable x. ernie and bert disagree about what will be printed

  If the user wants to read the input from a file then the

if the user wants to read the input from a file then the output will also go into a different file. if the user wants

  Question 1we are given the following knowledge base of

question 1we are given the following knowledge base of travel informationnbspbycaraucklandhamilton.

  Basic requirementsscreen one has three edittext views and

basic requirementsscreen one has three edittext views and one button.the edittext views allow you to enter a students

  Create a application using the mvc architecture no

create a application using the mvc architecture. no scripting elements are allowed in jsp

  Rtl sa is a company which develops bespoke solutions for

rtl sa is a company which develops bespoke solutions for the rubber industry. they produce both rubber compound which

  Design a program that models the worms behavior in the

design a program that models the worms behavior in the subsequent scenarioa worm is moving toward an apple. each time

  Problem build a class for a type called fractionnbspthis

problem build a class for a type called fraction.nbspthis class is used to show a ration of two integers.nbsp include

  Part - 1 object-oriented designwrite a program that allows

part - 1 object-oriented designwrite a program that allows an instructor to keep a grade book. each students has scores

  Soda vending machine designnbsp design a soda vending

soda vending machine designnbsp design a soda vending machine that can deliver three kinds of soda a b and c. allnbsp

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd