proja-test-cases.txt

来自「a Java program that reads in the followi」· 文本 代码 · 共 90 行

TXT
90 行
字号
Provided that it is ultimately the responsibility of the students to 
comprehensively test their program and make sure that it indeed 
satisfies all explicit and implicit requirements for a given project; 
the following few test cases are just ment to give you some ideas on 
how to go about testing your first project (projA):

	Test Case: 1 (valid inputs)
	Aim: To test if the number of months is zero the result is correct.
	Inputs:
		A (loan Amount)= 100000.00
		r (interest rate)= 10
		Y (number of years)= 10
		M (number of months)= 0

	Output:	
		R (monthly Repayents): $1356.21

        Test Case: 2 (valid inputs)
        Aim: To test if the number of months is not zero the result is correct.
        Inputs:
                A (loan Amount)= 100000.00
                r (interest rate)= 10
                Y (number of years)= 9
                M (number of months)= 12

        Output:
                R (monthly Repayents): $1356.21


        Test Case: 3 (valid inputs)
        Aim: To test if the number of years is zero and the number of months
	     is correct (i.e. <= 12) the result is correct.
        Inputs:
                A (loan Amount)= 100000.00
                r (interest rate)= 10
                Y (number of years)= 0
                M (number of months)= 12

        Output: 
                R (monthly Repayents): $9166.67


        Test Case: 4 (invalid inputs)
        Aim: To test that an invalud amount is not accepted.
        Inputs:
                A (loan Amount)= -100000.00
                r (interest rate)= 10
                Y (number of years)= 9
                M (number of months)= 12

        Output:
		Some error message for the invalid amount!


        Test Case: 5 (invalid inputs)
        Aim: To test that an invalud interest rate is not accepted.
        Inputs:
                A (loan Amount)= 100000.00
                r (interest rate)= -10
                Y (number of years)= 9
                M (number of months)= 12

        Output:
                Some error message for the invalid interest rate!


        Test Case: 6 (invalid inputs)
        Aim: To test that an invalud value for year(s) is not accepted.
        Inputs:
                A (loan Amount)= 100000.00
                r (interest rate)= 10
                Y (number of years)= -9
                M (number of months)= 12

        Output:
                Some error message for the invalid year(s)!


        Test Case: 7 (invalid inputs)
        Aim: To test that an invalud value for months is not accepted.
        Inputs:
                A (loan Amount)= 100000.00
                r (interest rate)= 10
                Y (number of years)= 9
                M (number of months)= -12

        Output:
                Some error message for the invalid months!

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?