pls help me with this , its urgent ! thanks.
1. Write a method that will return the sum of all digits in an integer. The method signature is as follows:
(for example, sum(1234) returns 10 and sum(12345) returns 15.)
public static int sum(int number)
2. Write a method that returns the number of days in a year using the following header:
public static int numberOfDaysInAYear(int year)
Write a test program that displays the number of days in year 2000, ..., and 2010.
Re: pls help me with this , its urgent ! thanks.
You have recently posted the following question in the forum:
Your post is called a "homework dump" as you have posted your assignment but have not shown any work. As this is not allowed, I've locked this post, and invite you instead to repost your question. In your new post, consider ...
Originally Posted by tasha
- Give us an informative thread title, one that summarizes your specific problem.
- Avoid using "urgent" and similar words as experience has shown that this will do nothing but turn many folks off from helping you.
- Show what you've done
- Ask as specific questions as possible such as how to fix such-and-such bug.
- If you are completely stuck, contact your instructor for one-on-one help.
- Also look at this link as it's very helpful suggestions: So, You Need to Write a Program but Don't Know How to Start
- And this link to help you write better forum questions: How To Ask Questions The Smart Way
Best of luck.