Develop a C++ program to add two complex number by overloading + operator using Member function.
1. Write an pseudo code and flowchart
Find the average, maximum, minimum, and sum of the numbers given by the user.
*Based on answer choices A-E, what is the code's output?
10. Which sample is a regular expression that accepts alphanumeric characters only?
A. [a-z0-9]
B. [a-zA-Z0-9]
C. [A-Z0-9]
D. [a-zA-Z]?[0-9]
E. [a-zA-Z]?(0-9)
*Based on answer choices A-E, what is the code's output?
9. Which can check if the letter "a" occurs n times only?
A. a?
B. a+
C. a=
D. a{n}
E. a(n)
*Based on answer choices A-E, what is the code's output?
8. Which of the following can match a, b, or c?
A. [abc]
B. [-abc]
C. [?abc]
D. [*abc]
E. [^abc]
*Based on answer choices A-E, what is the code's output?
6. Given the following code, the output is __.
String str = "Java";
System.out.print(str.concat("programming"));
A. Java programming
B. Javaprogramming
C. Java programming !
D. Javaprogramming!
E. !
*Based on answer choices A-E, what is the code's output?
4. Given the following code, the output is __.
String str = new String("persistent");
System.out.print(str.indexOf('e'));
A. 0
B. 1
C. 2
D. 3
E. 4
*Based on answer choices A-E, what is the code's output?
2. Given the following code, the output is __.
String str1 = new String("Apple");
String str2 = "Apple";
System.out.print(str1.equals(str2));
A. 0
B. 1
C. false
D. true
E. str2
USING ARRAYS
Q 4) Write a program to compute the following mathematical equation:
k=0nAk*B[n-k] Where n = 9
Q 5) Create a program to enter 20 elements into an array, create another array to copy only elements to the new array which are even and three digit. All other digits are to be replaced by maximum positive value.
Problem 2: Replace all vowels in sentence by the underscore character.
In this program, you ask user to enter a sentence and read it using string class function getline. Use a for loop to iterate through all characters. Please use str.at(i) method to access each string character. If a character is a vowel, replace it with ’ ’. Both upper and lower case vowels have to be replaced. Those who use an array for string are going to lose points as char.at(i) verifies that the character position in a string is valid. Example run:
Please enter a sentence:
Hello There!
You entered the sentence "Hello There!"
Your sentence after replacing vowels by underscores is H_ll_ Th_r_!