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
klio [65]
2 years ago
14

Write a C++ function for the following:

Computers and Technology
1 answer:
Nana76 [90]2 years ago
4 0

Solution :

class Account

$ \{ $

public:

$\text{Account}()$;

double $\text{getBalance}$();

void $\text{setBalance}$();

$\text{bool withdraw}$(double bal);

$\text{private}:$

double $\text{balance}$;

}:

$\text{Account}()$ {}

double $\text{getBalance}$()

$ \{ $

$\text{return balance}$;

}

void $\text{setBalance}$(double $\text{balance}$)

$ \{ $

this.$\text{balance}$ = $\text{balance}$;

}

$\text{boolean}$ withdraw($\text{double bal}$)

$ \{ $

if($\text{balance}$ >= bal)

$ \{ $

$\text{balance}$ = $\text{balance}$ - bal;

$\text{return}$ true;

}

$\text{return}$ false;

}

}

You might be interested in
"What technology will examine the current state of a network device before allowing it can to connect to the network and force a
slava [35]

Answer:

a network access control

3 0
3 years ago
How do you write 124.59 in expanded form?
scZoUnD [109]
124.59 in expanded form is:

100 + 20 + 4 + 0.5 + 0.09
8 0
2 years ago
Read 2 more answers
What is that black thing on my wall?
Darya [45]
I'm guessing your television if it's a flat screen
7 0
2 years ago
Which best describes an advantage of creating a contact group?
Lapatulllka [165]
More than one contact can be added to the group at a time.
8 0
3 years ago
What is the available vector for each resource and the need matrix for each thread. Note that an available vector depicts the qu
blsea [12.9K]

Answer:

If request granted then T₁ and T₂ are in deadlock.

Explanation:

See attached image

4 0
3 years ago
Other questions:
  • What is a flash player?
    9·2 answers
  • When pasting information copied from a Word document into an Excel spreadsheet, click in the cell that will be the _______ of th
    7·2 answers
  • Renee is creating a multimedia presentation for a website that requires user interaction. Which multimedia type is Renee using?
    5·2 answers
  • An alteration threat violates information integrity. <br> a. True <br> b. False
    13·1 answer
  • You have created a new dhcp scope with address range 192.168.1.1 to 192.168.1.254. you have five servers configured with static
    9·1 answer
  • A representation of something by using a description, summary or image.
    7·1 answer
  • List at least 5 professions for people working in the Information/Communication<br> fields.
    10·1 answer
  • When creating envelopes, how will you adjust the layout?
    10·2 answers
  • The while loop is also known as what kind of a loop? entry-control loop operational loop infinite loop user-control loop
    15·1 answer
  • Alice is watching a speech over the internet. what type of message is alice attending to?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!