Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 305 Weeks Ago, 4 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 16 Jul 2017 My Price 7.00

positive scalar integers

Write a function called older that takes as its input arguments six positive scalar integers: y1, m1, d1, y2, m2, d2, in that order, representing the birthdates of two persons. The variables that start with y stand for the year, m for the month and d for the day. The variables that end in 1 correspond to the first person, while those that end in 2 correspond to the second person. The function returns 1 if the first person is older, 0 if they have the same age, and -1 if the first person is younger

You do not need to check whether the inputs have appropriate values. For example, you may assume that both m1 and m2 are positive integers that are less than 13 and that the day numbers fit with their months.

 

Answer

function a = older(y1,m1,d1,y2,m2,d2)

a = 1;

if y1 == y2 && m1 == m2 && d1 == d2

a = 0;

elseif (y1 > y2) || (y1 == y2 && m1 > m2) || (y1 == y2 && m1 == m2 && d1 > d2)

a = -1;

end

end

Answers

(5)
Status NEW Posted 16 Jul 2017 10:07 PM My Price 7.00

Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- Th-----------ank----------- Yo-----------u f-----------or -----------usi-----------ng -----------our----------- we-----------bsi-----------te -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill-----------

Not Rated(0)