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
Bumek [7]
2 years ago
8

Instructions

Computers and Technology
1 answer:
Thepotemich [5.8K]2 years ago
8 0

The output file stream will be coded as such

   ofstream output_file;

   output_file.open("Ch4_Ex15_Output.txt", ios::out);

   output_file << balance;

   input.close();

   output_file.close();

   return 0;

}

<h3>Output file stream</h3>

Generally, Given the instructions we see that the program will "output account balance before and after withdrawal and service charges"

Therefore we must conclude at the output file stream bearing all information required.

double withdraw(double balance) {

   cout << "Current Balance in the account: " << balance << endl;

   if(balance <= 0) {

       cout << "Insufficent balance" << endl;

       return balance;

   }

   double withdraw;

   cout << "Amount of money for withdraw: "; cin >> withdraw;

   if(withdraw > 500) {

       cout << "$500 per day can be withdrawn!";

       return balance;

   }

   double charge = 0;

   if(balance >= withdraw) {

       balance -= withdraw;

       charge = (withdraw <= 300) ? 0 : (withdraw - 300) * 0.04;

   }

   else {

       char option;

       cout << "Insufficient funds! Service charged $25, Want to withdraw money?(Y/N): ";

       cin >> option;

       if(option == 'Y' || option == 'y') {

           balance -= withdraw;

           charge = 25;

       }

   }

   balance -= charge;

   cout << "balance after Withdraw: " << balance << endl;

   cout << "charge for transaction: " << charge << endl;

   return balance;

}

int main() {

   ifstream input;

   input.open("Ch4_Ex15_Data.txt", ios::in);

   double balance;

   input >> balance;

   balance = withdraw(balance);

   ofstream output_file;

\therefore the output stream is

   output_file.open("Ch4_Ex15_Output.txt", ios::out);

   output_file << balance;

   input.close();

   output_file.close();

   return 0;

}

More on Algorithm

brainly.com/question/11623795

You might be interested in
What is the most important for you to choose before you build a network?
olga nikolaevna [1]
Network media is most important
4 0
3 years ago
Opportunities in nanotechnology apply broadly to many fields. Identify TWO areas of IT that may be impacted by its further devel
Soloha48 [4]

Answer:

a. quantum computing and telecommunications

Explanation:

Both quantum computing and telecommunications need materials with specific optical, electrical, and magnetic properties to advance, and nanotechnologies open the opportunity for nanomaterial with incredible properties. From antennas with special magnetic properties to faster optical fiber from more stable material to store qubits to super thermal insulators, nanotechnologies will change the way we build and design telecommunication systems, and it will allow us to build stable and reliable quantum computers.

7 0
2 years ago
What is the major benefit Smartphones and tablet computers have had on social media?
Naddika [18.5K]

Answer:

c

Explanation:

The biggest advantage of smartphones and tablets is that they increased the mobility. This allowed users to access the social media platforms whenever they want. The users can login to their accounts even they are travelling by bus or walking around. This was not possible back in the days where people mostly use desktop computers.

8 0
2 years ago
Question :
BlackZzzverrR [31]

Answer:

D

Explanation:

Search engine optimization (SEO)

4 0
3 years ago
Fill in the blank with the correct response.
harina [27]

Answer:

program

Explanation:

6 0
2 years ago
Other questions:
  • How can you check an orthographic drawing to be sure there are no missing lines
    5·2 answers
  • You are given n sorted sequences each one containing n keys. You may assume n is a power of two. We want to merge them into one
    15·1 answer
  • Can a computer will work more efficiently if you perform disk optimization
    9·1 answer
  • Which line in the following program contains the header for the showDub function? 1 #include«iostream» 2 using namespace std; 4
    15·1 answer
  • What is the internet ?
    11·2 answers
  • Which of the following allows the transmission of voice and often video communication over the internet?
    12·1 answer
  • ¿porque y como surge la informatica y las computadoras
    13·1 answer
  • Why don’t the ads on Brainly load anymore
    14·2 answers
  • Paolo, a popular basketball player in school was asked by his coach, how is your family
    8·1 answer
  • Select the statements that are true regarding IP addresses. Check All That Apply assigned to your home network by your ISPassign
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!