Posted by **Annabelle** on Tuesday, April 29, 2014 at 10:55pm.

Write a function that takes one positive integer value (call it n) as a parameter and produces the sum of the integers between 1 and n.

Hint: The sum of the integers from 1 to n is n*(n+1) all over 2

I know this is how the function should look but I am unsure of how to write the actual code!

(n*(n+1))/2

- Programming -
**Annabelle**, Tuesday, April 29, 2014 at 10:55pm
In Visual Basic Form..

- Programming -
**Anonymous**, Tuesday, May 6, 2014 at 7:53pm
Create a full program with proper instructions for the user that asks the person to choose between the following options:

Find out if a year a leap year

Number of days in a month for any given year

Print out the number of days in a year, a leap year, and weeks in a year.

After the user makes their choice calculate the appropriate answers and give fully defined answers. In other words do not simply return True or False for the first choice, give a full response such as "2012 is a leap year."

Properly test the user inputs and respond with error instructions if a wrong or invalid choice is made.

## Answer This Question

## Related Questions

- math, algebra - 2a+2ab+2b I need a lot of help in this one. it says find two ...
- Math - Let S(n) denote the sum of digits of the integer n. Over all positive ...
- maths - the non- decreasing sequence of odd integers {a1, a2, a3, . . .} = {1,3,...
- math - Find the sum of the first one thousand positive integers. Explain how you...
- discrete math - 1)prove that if x is rational and x not equal to 0, then 1/x is ...
- math - there are 8 consecutive integers that add up to 31. Only two of the ...
- math - Which statement is true? A.The sum of two positive integers is sometimes ...
- Algebra 1 - The average of five consecutive integers is 13. One of the integers ...
- Math - Tell whether the sum between the two integers is always, sometimes, or ...
- math - What is the smallest of three consecutive integers if the sum of the ...

More Related Questions