Visual Basic 1.Order the integer data types by their relative size and the decim
ID: 3592917 • Letter: V
Question
Visual Basic
1.Order the integer data types by their relative size and the decimal-type data types by their relative size. Give an example that can be encapsulated by that level, but not ones lower than it.
2.
How do the following structures differ in execution? Give an example of a task that might benefit from each structure.
a. IF THEN
b. IF THEN ELSE
c. IF THEN ELSEIF THEN
d. IF THEN ELSEIF THEN ELSE
e. SELECT CASE
3.Write a function that will determine that a text string contains exactly one @ symbol and furthermore that the characters after that symbol contain at least one “.” that is not the first character nor the last. [Incidentally, this is important to e-mail validation]
Explanation / Answer
// Recursive C++ program to check if a string is subsequence of another string
#include<iostream>
#include<cstring>
using namespace std;
// Returns true if str1[] is a subsequence of str2[]. m is
// length of str1 and n is length of str2
bool isSubSequence(char str1[], char str2[], int m, int n)
{
// Base Cases
if (m == 0) return true;
if (n == 0) return false;
// If last characters of two strings are matching
if (str1[m-1] == str2[n-1])
return isSubSequence(str1, str2, m-1, n-1);
// If last characters are not matching
return isSubSequence(str1, str2, m, n-1);
}
// Driver program to test methods of graph class
int main()
{
char str1[] = "gksrek";
char str2[] = "geeksforgeeks";
int m = strlen(str1);
int n = strlen(str2);
isSubSequence(str1, str2, m, n)? cout << "Yes ":
cout << "No";
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.