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 ...
- discrete math - 1)prove that if x is rational and x not equal to 0, then 1/x is ...
- Math - Let S(n) denote the sum of digits of the integer n. Over all positive ...
- 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 ...
- math, probability - There are six ways to write 5 as an ordered sum of three ...
- math - A. Four times one odd integer is 14 less than three times the next even ...
- college math - I do not understand a problem from a text book or how to solve ...
- algebra2 - Two consecutive positive integers have the property that one integer ...
- algebra 101 - the sum of two integers is 10. three times one integer is 3 less ...

More Related Questions