C# Question   Create a desktop application that allows the user to enter a maximum integer. The application should sum all the even integers from zero up to and including that maximum number if it is even. The sum should be displayed in the form. For example: For a maximum integer of 50 the sum is 650. For a maximum integer of 11 the sum is 30. The program should have a method named SumEvens that receives the maximum integer as an argument and returns the sum of the even numbers. The SumEvens method should use a for loop to calculate the sum of the even numbers.

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 12PE
icon
Related questions
Question

C# Question

 

Create a desktop application that allows the user to enter a maximum integer. The application should sum all the even integers from zero up to and including that maximum number if it is even. The sum should be displayed in the form. For example:

  • For a maximum integer of 50 the sum is 650.
  • For a maximum integer of 11 the sum is 30.

The program should have a method named SumEvens that receives the maximum integer as an argument and returns the sum of the even numbers. The SumEvens method should use a for loop to calculate the sum of the even numbers.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT