On the planet Mongo, each year has 15 months and each month has 26 days.
Write a function compute_mongo_age(birthYear, birthMonth, birthDay, currentYear, currentMonth, currentDay)
that residents of Mongo can use to compute their age. It should take 6 positive integers as input: the person's birthdate (year, month from 1 to 15, and day from 1 to 26) and the current date (year, month from 1 to 15, and day from 1 to 26), and return a float of the age of the person in years.

For example, print(compute_mongo_age(2879,8,11,2892,2,21)) should print 12.6256410256, the age (in Mongo years) of a person, who was born on the 11th day of the 8th month of the year 2879, is on the 21st day of the 2nd month of the year 2892.

Answers

Answer 1

Answer:

DateTime now = DateTime.Today;

int age = now.Year - bday.Year;

if (now < bday.AddYears(age))

age--;

So your helper method would look like:

public static string Age(this HtmlHelper helper, DateTime birthday)

{

DateTime now = DateTime.Today;

int age = now.Year - birthday.Year;

if (now < birthday.AddYears(age))

age--;


Related Questions

Other Questions
Some of the principles of ethical violations discussed in class are the following: stress and psychological harm, deception, invasion of privacy, breach of confidentiality, involuntary recruitment, use of special populations, withholding beneficial treatment, and fraud. The following research situations illustrate one or more possible ethical violations. For each situation: (1) Identify what you believe are the violations of ethical principles which are most apparent. (2) Explain your answers. (3) State how the violations can be remedied. (4) After all 12 situations are analyzed, rank the violations according to minor, moderate, and major ethical violations Why did only committee members know about what happened after people were released? choose the correct answer 1. a) William is a factory's workerb) William is a factory worker 2.a) I enjoy visiting my friend home.b) I'm driving looking my friends home c) I enjoy visiting friends' home When dragons on planet Pern lay eggs, the eggs are either green or yellow. The biologists have observed over the years that 21% of the eggs are yellow, and the rest green. Next spring the lead scientist has permission to randomly select 58 of the dragon eggs to incubate. Consider all the possible samples of 58 dragon eggs.What is the usual number of yellow eggs in samples of 58 eggs? (Give answers as SENSIBLE whole numbers.)minimum usual number of yellow eggs =maximum usual number of yellow eggs Solve The Inequality Evaluate 4log4(3,100) Please Help!find the value of x round to the nearest tenth as needed purchased heavy equipment by giving the seller a $30,000 cash down payment and a 5-year interest-bearing note for the $170,000 balance of the price. Compute Pettit's book basis and tax basis in the equipment Danielle stayed in three different cities (Washington, D.C., Atlanta, Georgia, and Dallas, Texas) for a total of 22 nights. She spent twice as many nights in Dallas as she did in Washington. The total cost for 22 nights (excluding tax) was $3,100. Determine the number of nights that she spent in each city. please help solve this (geometry) section 3: crivez la phrase manquante dans chaque srie. 1) Il a du gteau , ________ , Il a le plus de gteau2) ______ , Ma fille est plus Jeune , Ma fille est la plus Jeune 3) ces bijoux sont chers, ces bijoux sont plus chers, _____ Help me plz I need help The shiny silver mouse has a population mean size of 8.3 cm and and a population standard deviation of 1.2 cm. If one individual is sampled from the population what is the probability that it will be greater than 9 cm A is 2 times older than B. Identify the appropriate expression. A kite is shown. Lines are drawn from each point to the opposite point to form a letter t.A company designs a logo using a kite figure around the letter t.The logo is 12 centimeters wide and 16 centimeters tall. What is the area of the logo?48 sq. cm96 sq. cm144 sq. cm192 sq. cm What is the name of for a different froms of gene While reading any text, it is important for readers to consider:A) A Word's part of speechB) The verb tense of a wordC) The multiple meanings a word might haveD) All of the choices are correct Almost all people have at one time or another experienced (select all that apply): Schizophrenia Anxiety Depression Bipolar Susan went to an oncologist because some cancerous cells had been detected within her breasttissue. Which of the following is NOT a warning signal for cancer? Simplify the expression to lowest terms.4x2-9/2 x2 + 11 x +12