-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArithmatic funtion method .txt
57 lines (33 loc) · 1.17 KB
/
Arithmatic funtion method .txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
question
Create the logic for a program that performs arithmetic functions. Design the program to:
• contain two numeric variables
• prompt the user for values for the variables
• pass both variables to methods named sum() and difference().
Create the logic for the methods sum() and difference(); they compute the sum of and
difference between the values of two arguments, respectively. Each method should perform
the appropriate computation and display the results.
start
Declarations
num numberOne
num numberTwo
output " enter the first number "
numberOne = Convert.ToIn32(ReadLine)
output " enter the second number "
numberTwo = Convert.ToIn32(ReadLine)
// call method
Sum(numberOne, numberTwo)
//call method
difference(numberOne, numberTwo)
stop
void Sum(numberOne, numberTwo)
Declarations
num sum
sum = numberOne + numberTwo
output "the sum of the numbers is: " + sum
return
void difference(numberOne, numberTwo)
Declarations
num difference
difference = numberOne - numberTwo
output " the difference of the numbers is : " + difference
return