Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

According to the following code apply: 1. PC 2. CC 3. CoC 4. GACC 3 public class PrintCalendar { 4 /** Main method */ 5

According to the following code apply: 1. PC 2. CC 3. CoC 4. GACC 3 public class PrintCalendar { 4 /** Main method */ 5 public static void main(String[] args) { 6 Scanner input = new Scanner(System.in); 7 8 // Prompt the user to enter year 9 System.out.print("Enter full year (e.g., 2001): "); 10 int year = input.nextInt(); 11 12 // Prompt the user to enter month 13 System.out.print("Enter month in number between 1 and 12: "); 14 int month = input.nextInt(); 15 16 // Print calendar for the month of the year 17 printMonth(year, month); 18 } 19 20 /** Print the calendar for a month in a year */ 21 public static void printMonth(int year, int month) { 22 // Print the headings of the calendar 23 printMonthTitle(year, month); 24 25 // Print the body of the calendar 26 printMonthBody(year, month); 27 } 28 29 /** Print the month title, e.g., May, 1999 */ 30 public static void printMonthTitle(int year, int month) { 31 System.out.println(" " + getMonthName(month) 32 + " " + year); 33 System.out.println("-----------------------------"); 34 System.out.println(" Sun Mon Tue Wed Thu Fri Sat"); 35 } 36 37 /** Get the English name for the month */ 38 public static String getMonthName(int month) { 39 String monthName = ""; 40 switch (month) { 41 case 1: monthName = "January"; break; 42 case 2: monthName = "February"; break; 43 case 3: monthName = "March"; break; 44 case 4: monthName = "April"; break; 45 case 5: monthName = "May"; break; 46 case 6: monthName = "June"; break; 47 case 7: monthName = "July"; break; 48 case 8: monthName = "August"; break; 49 case 9: monthName = "September"; break; 50 case 10: monthName = "October"; break; 51 case 11: monthName = "November"; break; 52 case 12: monthName = "December"; 53 } 54 55 return monthName; 56 } 57 58 /** Print month body */ 59 public static void printMonthBody(int year, int month) { 60 // Get start day of the week for the first date in the month 61 int startDay = getStartDay(year, month); 62 63 // Get number of days in the month 64 int numberOfDaysInMonth = getNumberOfDaysInMonth(year, month); 65 66 // Pad space before the first day of the month 67 int i = 0; 68 for (i = 0; i

i need to find the predicate coverage, clause coverage , combinatorial coverage and the general active clause coverage for the following code, i know that it's switch cases and for loops and if conditions but i don't know how to write it like a predicate in logic coverage
it's something close to the attached image image text in transcribed
Predicate Coverage Example ((a = no) predicate coverage Predicate = true a = 5, b = 10, D = true, m = 1, n = 1,0 = | = (5 = 1*1) = true V true ^ TRUE = true Predicate = false a = 10, b = 5, D = false, m = 1, n = 1,0 = | = (10 = 1*1) false v false A TRUE false Ammann & Olu Induction to Software Testing. Edition 2 (Ch 8)

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

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions

Question

What is a mortgage payable?

Answered: 1 week ago

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago