subject

Visual basic programmingwrite code to create a class definition for account.1. these are the needed specs for the class. there is only one constructor for this class that receives two strings: firstname, and lastname. the values of these strings will be passed from the client code. see below for what to do with these strings. an account starts with a $100 balance (see balance property below).2. id. during creation (inside sub new), the id value is made of the user’s first name followed by the underscore followed by the last name, for example if passed “john” and “smith”, the id value is john_smith id is a string property that is read-only.3. password. during creation the value for password the same as the id with the added string "change". afterwards, the password may not be "displayed" to the client. however, client may change the password, using changepassword method below. this makes password a write-only property. to force the end user to change their password before using their account, a boolean variable, passwordreset, is set to true under sub new. this variable is to changed false under the changepassword method below.4.an account balance is a number with fractions: · this property is read-only.· amounts withdrawn or deposited into the account affect the balance, using the deposit and withdraw method below. account has the following methods: 1. deposit which takes two arguments, an amount (to be deposited as a number with fractions), and password (a string). if passwordreset is false, then check if the password passed matches the account password then the actions below are possible, otherwise an error message is shown. if passwordreset is true issue an error message to change the password first. if the amount passed is > 0 then add it to the current balance (recall balance is read-only), otherwise another error message is shown.2.withdraw which takes two arguments, an amount (to be withdrawn as a number with fractions), and password (a string). the logic to withdraw is the same as the logic to deposit, except that we must additionally check if the withdrawal will cause the balance to be negative), then no withdrawal is possible. issue an error message (make sure the balance is not changed). otherwise f the amount passed is > 0 then deduct from the current balance (recall balance is read-only), otherwise another error message is shown.3.changepassword is a method that takes two string, current password and a new password, if the current password matches the account password, change the account password to the new password, and issue a message, otherwise issue an error message. do not add any comments to your code anywhere in this test. it makes it hard to read the answer code.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, mariahrpoulin9630
Which part of the cpu accepts data?
Answers: 1
image
Computers and Technology, 23.06.2019 00:00, dubouuu
Donna and her team of five have invented a new gadget for the science exhibition in their college. which intellectual property right will protect their invention?
Answers: 1
image
Computers and Technology, 23.06.2019 21:20, FlowerChild1229
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
image
Computers and Technology, 24.06.2019 17:00, GreenHerbz206
What are some examples of what can be changed through options available in the font dialog box? check all that apply. font family italicizing bolding pasting drop shadow cutting character spacing special symbols
Answers: 2
You know the right answer?
Visual basic programmingwrite code to create a class definition for account.1. these are the needed...

Questions in other subjects:

Konu
Mathematics, 24.03.2021 23:40
Konu
Mathematics, 24.03.2021 23:40