Question

In: Computer Science

• Based on the following code snippet and plan attributes, provide the output for Plan A,...

• Based on the following code snippet and plan attributes, provide the output for Plan A, Plan B and Plan C.

Code Snippet
• {{IF:[Copay]=Not Covered && [Coinsurance]=Not Covered, show ‘Not covered’}}
• {{IF:[Copay]!=$0.00 && [Copay]!=Blank, show value from {{Copay}} copayment}}
• {{IIF:[Copay]!=$0.00 && [CopayFrequency]!=Blank, show {{Copay}} copayment/{{CopayFrequency}}}}
• {{IF:[CopayMax]=$0.00 OR [Copay]=$0.00, show No Charge}}
• {{IF:[[CopayMax]!=$0.00 && [CopayMax] contains ‘$’ && [Coinsurance] contains ‘%’ && [CopayMaxFrequency]=Blank, show {{CopayMax}} copayment then {{Coinsurance}} coinsurance]}}
Plan
Copay
CopayFrequency
CopayMax
CopayMaxFrequency
Coinsurance
Plan A
$10.00
Per Visit
$50.00
Per Visit
Not Covered
Plan B
$0.00
Not Applicable
$0.00
Not Applicable
Not Covered
Plan C
$50.00

$50.00
Per Session
10%

Solutions

Expert Solution

i. {{IF:[Copay]=Not Covered && [Coinsurance]=Not Covered, show ‘Not covered’}}

Conditions: The code checks if Copay is NotCovered and Coinsurance is Not Covered, the result should be Not Covered

Output: The above code will have below output:

None of the plan meets the condition in code, thus Show will not display anything for any plan.

ii. {{IF:[Copay]!=$0.00 && [Copay]!=Blank, show value from {{Copay}} copayment}}

Conditions: The code checks if Copay is not 0 and blank , the result should show Copay value.

Output: The above code will have below output:

Plan A and C meet the condition in code, thus Show below values :

Plan Copay CopayFrequency CopayMax CopayMaxFrequency Coinsurance Show
Plan A $   10.00 Per Visit $            50.00 Per Visit Not Covered $                  10.00
Plan C $   50.00 $            50.00 Per Session 10% $                  50.00

iii. {{IIF:[Copay]!=$0.00 && [CopayFrequency]!=Blank, show {{Copay}} copayment/{{CopayFrequency}}}}

Conditions: The code checks if Copay is not 0 and CopayFrequency is not blank , if both conditions are true, the result should show Copay/Frequency value.

Output: The above code will have below output:

Plan A meets the condition in code, thus Show below values :

Plan Copay CopayFrequency CopayMax CopayMaxFrequency Coinsurance Show
Plan A $   10.00 Per Visit $            50.00 Per Visit Not Covered $ 10/Per visit

iv. {{IF:[CopayMax]=$0.00 OR [Copay]=$0.00, show No Charge}}

Conditions: The code checks if CopaMaxy is 0 OR Copay is 0, if any of the conditions is true, the result should show ‘No Charge’ value.

Output: The above code will have below output:

Plan B meets the condition in code, thus Show below values:

Plan Copay CopayFrequency CopayMax CopayMaxFrequency Coinsurance Show
Plan B $0.00 Not Applicable $0.00 Not Applicable Not Covered No Charges

v. {{IF:[[CopayMax]!=$0.00 && [CopayMax] contains ‘$’ && [Coinsurance] contains ‘%’ && [CopayMaxFrequency]=Blank, show {{CopayMax}} copayment then {{Coinsurance}} coinsurance]}}

Conditions: The code has combination of conditions where it checks if

a. CopaMaxy AND CopayMax has $

b. AND Coinsurance has %

c. AND CopayMaxFrequency is Blank

If all conditions a, b, c are true, then show copaymax value then coinsurance value.

Output: The above code will have below output:

Let’s consider the sub conditions,

a. Is satisfied for all plans

b. Is satisfied for Plan C (as it has %)

c. Is not satisfied for any plan as each plan has a value for this

Thus no plan meets the condition and result nothing.


Related Solutions

[50%] Code Snippet Given snippet code below that you are required to complete. You are not...
[50%] Code Snippet Given snippet code below that you are required to complete. You are not allowed to make a new function or change any given code. Please complete each section that are marked with the notation “INSERT YOUR CODE HERE”. Once you complete the snippet below, your output should have the same result with the given output below. Descriptions: [15%] isValid() This function is for checking that there is no duplicated employee data in the linked list. This function...
Write a code snippet for the following:   You need to control the maximum number of people...
Write a code snippet for the following:   You need to control the maximum number of people who can be in a   restaurant at any given time. A group cannot enter the restaurant if they   would make the number of people exceed 100 occupants. Use random numbers   between 1 and 20 to simulate groups arriving to the restaurant. After each   random number, display the size of the group trying to enter and the number   of current occupants. As soon as the...
pleade provide the output and a brief explanation of the following C++ code: double dec1 =...
pleade provide the output and a brief explanation of the following C++ code: double dec1 = 2.5; double dec1 = 3.8; double *p, *q; p = &dec1; *p = dec2 - dec1; q = p; *q = 10.0; *p = 2 * dec1 + (*q); q =&dec2; dec1 = *p + *q; cout<<dec1<<" "<<dec2<< endl; cout<<*p<<" "<<*q<< endl; The following code should output the radius of th ebase, height , volume, and surface area of a cylinder. However, it fails...
5. In the following code snippet, which member function of the class Car is called first?...
5. In the following code snippet, which member function of the class Car is called first? class Car { public: void start(); void accelerate(double acc_speed); void stop(); double get_speed() const; Car(); private: double speed; }; Car::Car() { speed = 0; } void Car::start() { accelerate(get_speed() + 10); } void Car::stop() { speed = 0; } void Car::accelerate(double acc_speed) { speed = speed + acc_speed; } double Car::get_speed() const { return speed; } int main() { Car c1; c1.start(); c1.accelerate(10); c1.get_speed();...
*****IN JAVA***** A run is a sequence of adjacent repeated values. Write a code snippet that...
*****IN JAVA***** A run is a sequence of adjacent repeated values. Write a code snippet that generates a sequence of 20 random die tosses in an array and that prints the die values, marking the runs by including them in parentheses, like this: 1 2 (5 5) 3 1 2 4 3 (2 2 2 2) 3 6 (5 5) 6 (3 3) Use the following pseudocode: inRun = false for each valid index i in the array If inRun...
*****IN JAVA***** Write a code snippet that initializes an array with ten random integers and then...
*****IN JAVA***** Write a code snippet that initializes an array with ten random integers and then prints the following output: a. every element (on a single line) b. every element at an even index (on a single line) c. every even element (on a single line) d. all elements in reverse order (on a single line) e. only the first and last elements (on a single line)
Consider this code snippet: if (x < 512) { y = 73; } else { y...
Consider this code snippet: if (x < 512) { y = 73; } else { y = 42; } Which of these goto-style code snippets is equivalent to that if/else code? Consider this code snippet: if (x < 512) { y = 73; } else { y = 42; } Which of these goto-style code snippets is equivalent to that if/else code? a. if (x >= 512) goto Label1; y = 73; goto Label2; Label1: y = 42; Label2: b....
Write a java code snippet to prompt the user for the number of names they’d like...
Write a java code snippet to prompt the user for the number of names they’d like to enter. Create a new array of the size chosen by the user and prompt the user for each of the names. Output the list of names in reverse order.
Trace the execution of my_recursive_function(100) and my_recursive_function(32) for the following code snippet. [0.5 M] void my_recursive_function(int...
Trace the execution of my_recursive_function(100) and my_recursive_function(32) for the following code snippet. [0.5 M] void my_recursive_function(int n) { if(n == 0) { printf("False"); return; } if(n == 1) { printf("True"); return; } if(n%2==0) my_recursive_function(n/2); else { printf("False"); return; } } int main() { my_recursive_function(n); return 0; }
Explain line-by-line what the following snippet code from a .htaccess (WordPress) file means: # Restricts access...
Explain line-by-line what the following snippet code from a .htaccess (WordPress) file means: # Restricts access to PHP files from plugin and theme directories RewriteCond %{REQUEST_URI} !^/wp-content/plugins/file/to/exclude\.php RewriteCond %{REQUEST_URI} !^/wp-content/plugins/directory/to/exclude/ RewriteRule wp-content/plugins/(.*\.php)$ - [R=404,L] RewriteCond %{REQUEST_URI} !^/wp-content/themes/file/to/exclude\.php RewriteCond %{REQUEST_URI} !^/wp-content/themes/directory/to/exclude/ RewriteRule wp-content/themes/(.*\.php)$ - [R=404,L]
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT