现有人编写了帐号类Account,用于管理个人的存款余额, public Account{ private double balance; //帐号余额,余额最低为0 public double getBalance(){ return balance; } Public void setBalance(double b){ balance=b; } public double withdrawl(double money) throws Exception { //取款,money如果为负数或余额不足,抛出异常 } } 请用错误推测法为withdrawl()函数至少设计3个测试用例,并写出基于Junit的测试代码 。
现有人编写了帐号类Account,用于管理个人的存款余额, public Account{ private double balance; //帐号余额,余额最低为0 public double getBalance(){ return balance; } Public void setBalance(double b){ balance=b; } public double withdrawl(double money) throws Exception { //取款,money如果为负数或余额不足,抛出异常 } } 请用错误推测法为withdrawl()函数至少设计3个测试用例,并写出基于Junit的测试代码 。
相关考题:
YoucreateaPasswordSettingsobject(PSO).YouneedtoapplythePSOtoadomainusernamedUser1.Whatshouldyoudo() A.ModifythepropertiesofthePSO.B.ModifytheaccountoptionsoftheUser1account.C.ModifythesecuritysettingsoftheUser1account.D.ModifythepasswordpolicyoftheDefaultDomainPolicyGroupPolicyobject(GPO).
GivenanHttpServletRequestrequest,whichretrievesanobjectoftypeAccountwithanIdof“account”?() A.Accountaccount=request.getResource(”account”):B.Accountaccount=request.getAttribute(“account”):C.Accountaccount=request.getParameter(account”):D.Accountaccount=(Account)request.getResource(“account”):E.Accountaccount=(Account)request.getAttribute(“account”):F.Accountaccount=(Account)request.getParamter(“account”):
用于定义类成员的访问控制权限的一组关键字是A.extends 和 implementsB.public,private 和 protectedC.class和publicD.char,int,float和double
You are the administrator of a Windows Server 2003 computer named Testking1.Backups of the System State data of Testking1 occur each day by using the localAdministrator account.A new requirement restricts you from running services by using theAdministrator account. To meet the requirement, you create a new service accountnamed BackupTestking1 to be used for backups. You want this account to have theminimum permissions necessary to perform backups.You need to grant the appropriate permissions to the BackupTestking1 account andto configure the backup job to use the BackupTestking1 account.What should you do?()A. Add the BackupTestking1 account to the Server Operators group. Modify the backup Scheduled Task to use the BackupTestking1 account.B. Add the BackupTestking1 account to the Backup Operators group. Modify the backup Scheduled Task to use the BackupTesking1 account.C. Add the BackupTestking1 account to the Server Operators group. Modify the Task Scheduler service to use the BackupTestking1 account.D. Add the BackupTestking1 account to the Backup Operators group. Modify the Task Scheduler service to use the BackupTestking1 account.
下列选项中,列出用于定义类成员的访问控制权的一组保留字是()。A.class.float.double.publicB.fioat.Boolean.int,longC.char.extends.float.doubleD.public.private.protected
v 假设ICBCA_ACCOUNT和CBCA_ACCOUNT是用计算机语言定义的两个不同的类。前者代表工商银行账户,后者代表建设银行账户。ZhangSan_ICBCAccount和LiSi_ICBCAccount 是用ICBCA_ACCOUNT类定义的两个对象;ZhangSan_CBCAccount是用CBCA_ACCOUNT类定义的一个对象。下列说法中错误的是__(26)__。(26)A.ZhangSan_ICBCAccount是ICBCA_ACCOUNT类的一个实例B.ZhangSan_ICBCAccount和LiSi_ICBCAccount总具有相同的属性C.ZhangSan_ICBCAccount和LiSi_ICBCAccount总具有相同的状态D.ZhangSan_CBCAccount和LiSi_ICBCAccount总具有不同的操作
系统帐户信息保存在注册表中的位置是()。 A.HCU\SAM\SAM\Domains\Account\Users\NamesB.HCR\SAM\SAM\Domains\Account\Users\NamesC.HLM\SAM\SAM\Domains\Account\Users\NamesD.HCR\SAM\Domains\Account\Users\Names
用于定义类成员的访问控制权的一组关键字是()A.class, float, double, publicB.float, boolean, int, longC.char, extends, float, doubleD.public, private, protected