Create a program that asks the user for two doubles. Your program will include a static method called doMath. It should take in the two doubles that the user entered, add them together, multiply the answer by 2, and then round to the nearest integer. You will return this integer. Your static method only performs the math and returns the integer answer. Your static method should not ask for input or print output. Your main method should ask for input, call the method and pass in the user’s two values, and then print the result that is returned from the doMath method. This program does not have to loop and does not have to have any try/catch blocks.   Note: If your program does not perform the required tasks in a separate static method, you will not get any credit for this program.   Example:   Enter two numbers and I will do math things with them.   >>>5.1 >>>3.2

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter7: Using Methods
Section: Chapter Questions
Problem 2CP
icon
Related questions
Question
100%
  1. Create a program that asks the user for two doubles.

  2. Your program will include a static method called doMath. It should take in the two doubles that the user entered, add them together, multiply the answer by 2, and then round to the nearest integer. You will return this integer.

  3. Your static method only performs the math and returns the integer answer.

  4. Your static method should not ask for input or print output.

  5. Your main method should ask for input, call the method and pass in the user’s two values, and then print the result that is returned from the doMath method.

  6. This program does not have to loop and does not have to have any try/catch blocks.

 

Note: If your program does not perform the required tasks in a separate static method, you will not get any credit for this program.

 

Example:

 

Enter two numbers and I will do math things with them.

 

>>>5.1

>>>3.2

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT