1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kodGreya [7K]
3 years ago
13

Given an existing class, BankAccount, containing: a constructor accepting a String corresponding to the name of the account hold

er. a method, getBalance, that returns a double corresponding to the account balance. a method withdraw that accepts a double, and deducts the amount from the account balance. Write a class definition for a subclass, CheckingAccount, that contains: a boolean instance variable, overdraft. (Having overdraft for a checking account allows one to write checks larger than the current balance). a constructor that accepts a String and a boolean. The String parameter is used in the invocation of the superclass (BankAccount) constructor, while the boolean is used to initialize the overdraft instance variable. a method, hasOverdraft, that returns a boolean. hasOverdraft returns true if the account supports overdraft. a method, clearCheck, that accepts a double and returns a boolean. clearCheck will determine if the amount (of the check) can be cashed-- this will be the case if the amount is less than the balance in the account, or if the account allows overdraft. If the check can be cashed, clearCheck returns true, and also calls the withdraw method to update the account balance; otherwise, clearCheck returns false.

Computers and Technology
1 answer:
Dimas [21]3 years ago
4 0

Answer:

Refer below.

Explanation:

Refer to the picture for the brief explanation of the code.

You might be interested in
In Qbasic how I type the diference between two numbers?
zavuch27 [327]

Answer:

REM PROGRAM TO DISPLAY SUM OF TWO NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

S = A + B

PRINT “SUM OF TWO NUMBERS”; S

END

USING SUB PROCEDURE

DECLARE SUB SUM (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

CALL SUM(A, B)

END

SUB SUM (A, B)

S = A + B

PRINT “SUM OF TWO NUMBERS”; S

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION SUM (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

S = SUM(A, B)

PRINT “SUM OF TWO NUMBERS”; S

END

FUNCTION SUM (A, B)

SU = A + B

SUM = SU

END FUNCTION

2. Enter any two numbers and display its difference.

REM PROGRAM TO DISPLAY DIFFERENCE OF TWO NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

D = A - B

PRINT “DIFFERENCE OF TWO NUMBERS”; D

END

USING SUB PROCEDURE

DECLARE SUB DIFF (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

CALL DIFF(A, B)

END

SUB DIFF (A, B)

D = A - B

PRINT “DIFFERENCE OF TWO NUMBERS”; D

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION DIFF (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

DI = DIFF(A, B)

PRINT “DIFFERENCE OF TWO NUMBERS”; DI

END

FUNCTION DIFF (A, B)

D = A - B

DIFF = D

END FUNCTION

3. Enter any two numbers and display its product.

REM PROGRAM TO DISPLAY PRODUCT OF TWO NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

P = A * B

PRINT “PRODUCT OF TWO NUMBERS”; P

END

USING SUB PROCEDURE

DECLARE SUB PROD (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

CALL PROD(A, B)

END

SUB PROD (A, B)

P = A * B

PRINT “PRODUCT OF TWO NUMBERS”; P

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION PROD (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

PR = PROD(A, B)

PRINT “PRODUCT OF TWO NUMBERS”; PR

END

FUNCTION PROD (A, B)

P = A * B

PROD = P

END FUNCTION

4. Enter any two numbers and display its average.

REM PROGRAM TO DISPLAY AVERAGE OF TWO NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

AV = (A + B) / 2

PRINT “AVERAGE OF TWO NUMBERS”; AV

END

USING SUB PROCEDURE

DECLARE SUB AVERAGE (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

CALL AVERAGE(A, B)

END

SUB AVERAGE (A, B)

AV = (A + B) / 2

PRINT “AVERAGE OF TWO NUMBERS”; AV

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION AVERAGE (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

AVGR = AVERAGE(A, B)

PRINT “AVERAGE OF TWO NUMBERS”; AVGR

END

FUNCTION AVERAGE (A, B)

AV = (A + B) / 2

AVERAGE = AV

END FUNCTION

Explanation:

Pls mark brainliest

8 0
2 years ago
Read 2 more answers
Productivity, rework, and technology impact are examples of which kind of software metric?
fgiga [73]

The correct answer should be process type of software metric. The process metrics are used to help in strategic decision making. The processes such as work products delivery, expended human hours and conformance to quality and schedule are all metrics in the process domain.

6 0
3 years ago
"Bookings are to be stored in three separate
Zina [86]

Answer:

it is a complete routine of life without it we cannot do time management

Explanation:

mark me brainliest ❤

5 0
3 years ago
What is the 10/20/30 rule?
Sophie [7]
This represents Guy <span>Kawasaki Rule for PowerPoint Presentations. Here is what it stands for: 

</span><span>10 slides are the optimal number to use in a  presentation.
20 minutes is the longest amount of time that you should speak.
<span>30 point font is the smallest font that you should use on slides.


</span></span>
3 0
3 years ago
To create a query string, you add a ____ immediately after a url, followed by the query string.
salantis [7]
The answer is question mark (?).  To create a query string, you add a question mark (?) immediately after a url, followed by the query string.
5 0
3 years ago
Other questions:
  • Select the correct answer.
    7·1 answer
  • Typically, when an organization purchases Internet access from an Internet Service Provider (ISP), the ISP will grant it
    5·1 answer
  • Write the header for a function addOne that accepts a single integer reference parameter and returns nothing. Name the parameter
    5·1 answer
  • Which of the following is an example of joint problem solving?
    12·1 answer
  • Choose the correct term to complete the sentence.
    10·2 answers
  • If a employee has a grade grater than or equal to 18, then he she will get 50% bonous on the basic pay. Otherwise, the employee
    5·1 answer
  • Which option is used in Access to locate and retrieve data that may be present in multiple database tables within the database?
    10·2 answers
  • What are common considerations businesses need to make before purchasing new computers? Check all of the boxes that apply.
    6·1 answer
  • A network administrator has asked robin, a network engineer, to use ospf (open shortest path first) along with rip (routing info
    11·1 answer
  • Interactivity and Blank______ are two important capabilities of the Internet in the Blank______ relationship.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!