I need to write a program that, depending on the user’s choice, inputs an integer, double or string variable.
If the variable is int or double, the program increases it by one (+ 1).
If the variable is a string, the program appends "*" at the end (+ "*").
Afterwards, I need to print the result at the console.
I must use switch statement.
Examples:
program
|
user
|
|
program
|
user
|
Please choose a type:
1 --> int
2 --> double
3 --> string
|
3
|
Please choose a type:
1 --> int
2 --> double
3 --> string
|
2
|
Please enter a string:
|
hello
|
Please enter a double:
|
1.5
|
hello*
|
|
2.5
|
|