Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design test cases for the program segment below using basic path testing (please follow the steps of basic path testing, 15 points). public void nextday(

Design test cases for the program segment below using basic path testing (please follow the steps of basic path testing, 15 points).

public void nextday( ){

1 switch( this.month){

2 case 1,3, 5, 7, 8, 10:

3 if( this.day == 31){

4 this.month = this.month + 1; this.day = 1; }

5 else{ this.day = this.day + 1; }

6 break;

7 case 4, 6, 9,11:

8 if( this.day == 30){

9 this.month = this.month + 1; this.day = 1; }

10 else{ this.day = this.day + 1; }

11 break;

12 case 12:

13 if( this.day == 31){

14 this.month = 1; this.day = 1; this.year = this.year + 1; }

15 else{ this.day = this.day + 1; }

16 break;

17 case 2:

18 if( this.isleap()){

19 if(this.day == 29) {

20 this.day = 1; this.month = 3; }

21 else{ this.day = this.day + 1; }

}

22 else{

23 if(this.day == 28){

24 this.day = 1; this.month = 3; }

25 else{ this.day = this.day + 1; }

}

26 break;

27 }

28 }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

Describe organized labors strategies for a stronger movement.

Answered: 1 week ago

Question

Explain the nature and role of safety, health, and wellness.

Answered: 1 week ago

Question

Identify the steps that lead to forming a bargaining unit.

Answered: 1 week ago