Question Write a complete C++ program that apply menu-driven style. Three options that should be created and executed are: Function 1 This user-defined function can accept four (4) parameters which is integer numbers. By using passing parameter by reference this function can change the original position of four numbers and return the multiplication result of four numbers. The changes and additional result are displayed in main() program. Example : 2 4 6 8 (original) , 8 6 4 2 (position changed) Multiplication result: 384 Note : Cannot use array. Function 2 This user-defined function can accept two (2) string which is array of character data type. In this function, use built-in function to compare this two string. Display the result whether both string similar or not similar in function 2. Example : char s1[20] is Drone char s2[20] is Drone , Output : similar Note : Cannot use pointer or string data type. Exit from the program. Notes: Refer Figure 1 below. The input (bold) can be initialized using = operator. No need to enter from keyboard. The initialization statement should be code/write in main() program. Just initialize and test for one sample of input of each option. Example : numbers is 2 4 6 8 first string is Drone and second string is Drone.
Question
Write a complete C++ program that apply menu-driven style. Three options that should be created and executed are:
- Function 1
This user-defined function can accept four (4) parameters which is integer numbers. By using passing parameter by reference this function can change the original position of four numbers and return the multiplication result of four numbers. The changes and additional result are displayed in main() program.
Example : 2 4 6 8 (original) , 8 6 4 2 (position changed)
Multiplication result: 384
Note : Cannot use array.
- Function 2
This user-defined function can accept two (2) string which is array of character data type. In this function, use built-in function to compare this two string. Display the result whether both string similar or not similar in function 2.
Example : char s1[20] is Drone char s2[20] is Drone , Output : similar
Note : Cannot use pointer or string data type.
- Exit from the program.
Notes:
Refer Figure 1 below. The input (bold) can be initialized using = operator. No need to enter from keyboard. The initialization statement should be code/write in main() program. Just initialize and test for one sample of input of each option.
Example :
numbers is 2 4 6 8
first string is Drone and second string is Drone.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images