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

What is the output of the following code snippet? (If there is some kind of syntax...
What is the output of the following code snippet? (If there is some kind of syntax error indicate this by marking "error" in your answer choice) 1.        int laps = 8;        if (laps++ > --laps)               laps += 2;        else if (--laps > (laps - 1))               laps += 4;        else if (++laps)               laps -= 3;        cout << laps << endl; 2. What is the output of the following code snippet?     int j = 47;     int i = 8;     j =...
[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...
I'm having trouble understanding the following code (a snippet of a code). What does it do?...
I'm having trouble understanding the following code (a snippet of a code). What does it do? The whole code is about comparing efficiencies of different algorithms. def partition(list,first,last): piv = list[first] lmark = first+1 rmark = last done = False while not done: while lmark <= rmark and list[lmark]<=piv: lmark=lmark+1 while list[rmark]>=piv and rmark>=lmark: rmark=rmark-1 if rmark<lmark: done = True else: temp = list[lmark] list[lmark]=list[rmark] list[rmark]=temp temp = list[first] list[first]=list[rmark] list[rmark]=temp return rmark
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();...
a. What will be the output of LINE A in code “a” and output of code...
a. What will be the output of LINE A in code “a” and output of code “b”? Also write reasons for the outputs. a. #include <sys/types.h> #include <stdio.h> #include <unistd.h> int value = 3; int main() { pid_t pid; pid = fork(); if (pid = = 0) {/* child process */} value += 233; return 0; } else if (pid > 0) {/* parent process */} wait(NULL); printf(“PARENT: value = %d”, value); /* LINE A */ return 0; } }...
*****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....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT