Test plan 3

.docx

School

University of Maryland, University College *

*We aren’t endorsed by this school

Course

115

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

4

Uploaded by DirtyMoe

Report
Test plan 3 Kaleb Miranda CMSC 115 Chapter 4 Programming project 1 Pseudocode: 1. Start 2. Display “This program calculates the area of a regular polygon.” 3. Prompt the user to enter the number of sides (n). 4. Read n from the user. 5. Prompt the user to enter the length of a side (s). 6. Read s from the user. 7. Calculate pi as 3.141592265359 8. Calculate angle = 360 degrees / n 9. Calculate area = (n * s^2) / (4 * tan(pi / n)) 10. Display “The area of the polygon is “ + area “ 11. End Flowchart: Start: Display program purpose Prompt user to enter number of sides Read n from user Prompt user to enter the legth of a side (s) Read s from user Calculate pi as 3.14159265359 Calculate angle = 360 degrees / n Calculate area = (n * s^2) / (4 * tan(pi / n)) Display "the area of the polygon is" + area. END
Test Plan: Test Case 1: Input: n = 5, s = 6.5 Expected Output: The area of the polygon is 72.69017017488385 Test Case 2: Input: n = 6, s = 8.0 Expected Output: The area of the polygon is 138.21243150588603 Test Case 3: Input: n = 8, s = 10.0 Expected Output: The area of the polygon is 309.0169943749474 Test Case 4: Input: n = 12, s = 15.0 Expected Output: The area of the polygon is 907.2290640106801 Test Case 5: Input: n = 3, s = 7.0 Expected Output: The area of the polygon is 31.745959053647685 Chapter 4 Programming project 5 Pseudocode: 1. Start 2. Display "Enter a SSN (in the format DDD-DD-DDDD): " 3. Read SSN from the user and store it in a string variable ssn 4. Set isValid to true 5. If the length of ssn is not equal to 11, then 6. Set isValid to false 7. For i from 0 to length of ssn - 1, do the following: 8. Get the character at position i and store it in a variable c 9. If i is equal to 3 or i is equal to 6, then 10. If c is not equal to '-', then
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help