- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise19.java
More file actions
Latest commit
14 lines (13 loc) · 604 Bytes
/
Copy pathExercise19.java
File metadata and controls
14 lines (13 loc) · 604 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
publicclassExercise19 {
publicstaticvoidmain(Stringarg[]) {
// Write a program that asks the user to enter two integers, x and y, and one string s.
// If the string entered by the user is "add", then the program should
// add x and y and print the result in a nicely formatted string. Similarly,
// handle the case where the user enters "subtract", "multiply", and other similar operations.
// For example:
// Please enter a number x: 25
// Please enter a number y: 7
// Please enter an operation: add
// Result: 25 + 7 = 32
}
}