/* * Aresh Saharkhiz * saharkiz@gmail.com * Associate Professor / Mapua Institute of Technology / Philippines */ using System; // Introduction to Software Testing // Authors: Paul Ammann & Jeff Offutt // Chapter 3, section 3.3, page 130 internal class twoPred_class { public static string twoPred(int x, int y) { bool z; if (x < y) { z = true; } else { z = false; } if (z && x + y == 10) { return "A"; } else { return "B"; } } public static void Main(string[] argv) { // Driver method for twoPred // Read two integers from standard input, call twoPred() int[] inArr = new int[argv.Length]; if (argv.Length != 2) { Console.WriteLine("Usage: java numZero v1 v2"); return; } for (int i = 0; i < argv.Length; i++) { try { inArr[i] = Convert.ToInt32(argv[i]); } catch (FormatException) { Console.WriteLine("Entry must be an integer, using 1."); inArr[i] = 1; } } Console.WriteLine("The result is: " + twoPred(inArr[0], inArr[1])); } }