Menu

7 20 Points Write C Program Called Subsetscpp Displays Subsets Set Problem Program Read N Q43872138

7. (20 points) Write a C++ program called all subsets.cpp which displays all subsets of a set. In the problem, your program sTest case 4 Number of input characters: 4 Enter 4 characters: V x y z Page 3 of 4 ===== All Subsets ===== empty {v} {x} {y} {

7. (20 points) Write a C++ program called all subsets.cpp which displays all subsets of a set. In the problem, your program should read n characters from a user and display all subsets of the characters. In the program, you can assume that the number of input characters is less than or equal to 15. Your program should ask a user to enter the number of input characters. After that, it should read the characters. For the problem, you can assume that the input characters are always distinct. Test case 1 Number of input characters: 1 Enter 1 characters: a ===== All Subsets ===== empty {a} Test case 2 Number of input characters: 2 Enter 2 characters: st ===== All Subsets ===== empty {5} {t} {s,t} Test case 3 Number of input characters: 3 Enter 3 characters: cba ===== All Subsets ===== empty {a} {b} {c} {a,b} {b,c} {a,c} {a,b,c} Test case 4 Number of input characters: 4 Enter 4 characters: V x y z Page 3 of 4 ===== All Subsets ===== empty {v} {x} {y} {v,X,Y,Z} Test case 5 Number of input characters: 10 Enter 10 characters: abcdefghij ===== All Subsets ===== empty {a} {b} {c} {a,b,c, d, e, f, g, h, i, j} Show transcribed image text 7. (20 points) Write a C++ program called all subsets.cpp which displays all subsets of a set. In the problem, your program should read n characters from a user and display all subsets of the characters. In the program, you can assume that the number of input characters is less than or equal to 15. Your program should ask a user to enter the number of input characters. After that, it should read the characters. For the problem, you can assume that the input characters are always distinct. Test case 1 Number of input characters: 1 Enter 1 characters: a ===== All Subsets ===== empty {a} Test case 2 Number of input characters: 2 Enter 2 characters: st ===== All Subsets ===== empty {5} {t} {s,t} Test case 3 Number of input characters: 3 Enter 3 characters: cba ===== All Subsets ===== empty {a} {b} {c} {a,b} {b,c} {a,c} {a,b,c}
Test case 4 Number of input characters: 4 Enter 4 characters: V x y z Page 3 of 4 ===== All Subsets ===== empty {v} {x} {y} {v,X,Y,Z} Test case 5 Number of input characters: 10 Enter 10 characters: abcdefghij ===== All Subsets ===== empty {a} {b} {c} {a,b,c, d, e, f, g, h, i, j}

Expert Answer


Answer to 7. (20 points) Write a C++ program called all subsets.cpp which displays all subsets of a set. In the problem, your prog…

OR