Examlex

Solved

Given the Following Method, What Method Call Will Return True

question 18

Multiple Choice

Given the following method, what method call will return true?
Public static boolean isValid(String input)
{
Boolean valid = true;
If (input.length() != 11)
{
Valid = false;
}
Else
{
If (input.charAt(3) != '-' || input.charAt(6) != '-')
{
Valid = false;
}
Else
{
Valid =
Character.isDigit(input.charAt(0) ) &&
Character.isDigit(input.charAt(1) ) &&
Character.isDigit(input.charAt(2) ) &&
Character.isDigit(input.charAt(4) ) &&
Character.isDigit(input.charAt(5) ) &&
Character.isDigit(input.charAt(7) ) &&
Character.isDigit(input.charAt(8) ) &&
Character.isDigit(input.charAt(9) ) &&
Character.isDigit(input.charAt(10) ) ;
}
}
Return valid;
}


Definitions:

Interest Rate

The percentage of a sum of money charged for its use, typically expressed as an annual rate.

Accrued Interest

Interest that has accumulated over a period but has not yet been paid or received.

Adjusting Journal Entry

A journal entry made at the end of an accounting period to record unrecognized income or expenses to ensure that the financial statements comply with the accrual concept of accounting.

Supplies Account

An account that records the costs of supplies on hand and used by a business, which can be a significant part of operating expenses depending on the business type.

Related Questions