Q.1.4 Q.1.5 Consider the following snippet of code being tested: 1. Print Please enter your age:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Q.1.4 Q.1.5 Consider the following snippet of code being tested: 1. Print "Please enter your age: 2. Read age 3. IF age >= 60 4. Print "Qualify for pensioner's discount" 5. ELSE 6. Print "Do not qualify for pensioner's discount" 7. ENDIF Assume you apply the following test case to the code snippet above: Test Case 1: age = 60 Q.1.4.1 Calculate the statement coverage achieved for Test Case 1 and provide a brief explanation for your response. Q.1.4.2 Calculate the decision coverage achieved for Test Case 1 and provide a brief explanation for your response. Discuss the importance of component testing. (3) (3) (4) Q.1.4 Q.1.5 Consider the following snippet of code being tested: 1. Print "Please enter your age: 2. Read age 3. IF age >= 60 4. Print "Qualify for pensioner's discount" 5. ELSE 6. Print "Do not qualify for pensioner's discount" 7. ENDIF Assume you apply the following test case to the code snippet above: Test Case 1: age = 60 Q.1.4.1 Calculate the statement coverage achieved for Test Case 1 and provide a brief explanation for your response. Q.1.4.2 Calculate the decision coverage achieved for Test Case 1 and provide a brief explanation for your response. Discuss the importance of component testing. (3) (3) (4) Q.1.4 Q.1.5 Consider the following snippet of code being tested: 1. Print "Please enter your age: 2. Read age 3. IF age >= 60 4. Print "Qualify for pensioner's discount" 5. ELSE 6. Print "Do not qualify for pensioner's discount" 7. ENDIF Assume you apply the following test case to the code snippet above: Test Case 1: age = 60 Q.1.4.1 Calculate the statement coverage achieved for Test Case 1 and provide a brief explanation for your response. Q.1.4.2 Calculate the decision coverage achieved for Test Case 1 and provide a brief explanation for your response. Discuss the importance of component testing. (3) (3) (4) Q.1.4 Q.1.5 Consider the following snippet of code being tested: 1. Print "Please enter your age: 2. Read age 3. IF age >= 60 4. Print "Qualify for pensioner's discount" 5. ELSE 6. Print "Do not qualify for pensioner's discount" 7. ENDIF Assume you apply the following test case to the code snippet above: Test Case 1: age = 60 Q.1.4.1 Calculate the statement coverage achieved for Test Case 1 and provide a brief explanation for your response. Q.1.4.2 Calculate the decision coverage achieved for Test Case 1 and provide a brief explanation for your response. Discuss the importance of component testing. (3) (3) (4)
Expert Answer:
Answer rating: 100% (QA)
The image contains a text question regarding the testing of a code snippet The snippet is a simple ifelse statement that checks whether the age variable is greater than or equal to 60 to print a messa... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
If the child has a mass of 10.7 kg, calculate the magnitude of the force in newtons the mother exerts on the child under the following conditions. (b) The elevator accelerates upward at 0.810 m/s....
-
Many Students earn "tips" as part of their income in their early working years. What statement best reflects the reporting of tips?
-
A bakery with a December 31 st year end purchased new equipment on October 31 st 2000 for $10,000. This was their first equipment purchase. Required: What are the tax consequences if the equipment is...
-
A nutritionally defective E. coli strain grows only on a medium containing thymine, whereas another nutritionally defective strain grows only on a medium containing leucine. When these two strains...
-
Given that p*(HzO) = 0.02308 atm and p (HzO) = 0.02239 atm in a solution in which 0.122 kg of a non-volatile solute (M = 241 g mol-1) is dissolved in 0.920 kg water at 293 K, calculate the activity...
-
Explain why it does not make sense to test for the main effects in a factorial experiment if the interaction effects are significant.
-
Determine algebraic equations for the pump head rise, power, and efficiency as functions of flow rate based on the data from Problem 12.18. Analytically determine the Best Efficiency Point and the...
-
Pin Corporation paid $1,800,000 for a 90 percent interest in San Corporation on January 1, 2011; San's total book value was $1,800,000. The excess was allocated as follows: $60,000 to undervalued...
-
Explain the following statement: Behaviors prime hormones; Hormones prime behavior. Sexual behavior primes aggression; Aggression primes sexual behaviors.
-
Is there evidence consistent with gender discrimination in training level? To answer this, proceed as follows: a. Create a table of counts for the two qualitative variables gender and training level....
-
On July 1, 20XX, Jeri Grohl invested $482,000 to open her company. What is the General Journal entry to record this transaction?
-
Course: Advanced Application Development 1. How do you create a Scanner object s that reads lines from the file in the src folder with file name defined by names.txt? String fileName = "names.txt"?...
-
Jaeger, Inc. bonds have a 9.78% coupon rate with semi-annual coupon payments. They have 19 years to maturity and a par value of $1,000. What is the current yield of the bond if the bond is selling at...
-
Folic Acid Inc. has $44 million in earnings, pays $5.4 million in interest to bondholders, and $3.2 million in dividends to preferred stockholders. What are the common stockholders' residual claims...
-
Does the following c program use a divide and conquer algorithim to find the max profit if it doesn't change it so there is a divide an conquer algorithim #include #include // Function to find the...
-
The advent of new technologies (the Internet, computerization, etc.) and the impact of globalization (products not only available from every country but being developed in multiple countries) has...
-
Generally, unemployment is referred to as one of the twine evils that arise from economic instability. (a) Mention two common types of unemployment that inevitably occur in almost every economy in...
-
A summary of changes in Pen Corporation's Investment in Sam account from January 1, 2011, to December 31, 2013, follows (in thousands): ADDITIONAL INFORMATION 1. Pen acquired its 80 percent interest...
-
While preparing Massie Miller's 2012 Schedule A, you review the following list of possible charitable deductions provided by Massie: Cash contribution to a family whose house burned...
-
Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is...
-
Dr. Ivan I. Incisor and his wife Irene are married and file a joint return for 2012. Ivan's Social Security number is 477-34-4321 and he is 48 years old. Irene I. Incisor's Social Security number is...
-
Give a comprehensive definition of auditing.
-
State the major changes which have occurred in auditing techniques during the last 160 years. Explain briefly how changes in technology have impacted on the changes in auditing techniques.
-
Under the provisions of the Companies Act 1985 an auditor's report must be attached to a company's financial statements. Is this true for all companies? Explain.
Study smarter with the SolutionInn App