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
Mike needs to write the primary objectives of a project in a project plan. In which section should he write them?
Advocard [28]

Mike needs to write the primary objectives of a project in a project plan. He should write this under the SCOPE section of the project plan.

Explanation:

  • Project scope is the part of project planning that involves determining and documenting a list of specific project goals, deliverables, features, functions, tasks, deadlines, and ultimately costs.
  • It is what needs to be achieved and the work that must be done to deliver a project.
  • The Scope of Work (SOW) is the area in an agreement where the work to be performed is described.
  • The SOW should contain any milestones, reports, deliverables, and end products that are expected to be provided by the performing party. The SOW should also contain a time line for all deliverables.
  • The scope is simply all the work that needs to be done in order to achieve a projects objectives.
  • A project scope, or project scope statement, is a tool used to describe the major deliverables of a project including the key milestones, high level requirements, assumptions, and constraints.

7 0
3 years ago
Sharon is thinking about opening a bakery. She knows she wants to set her own hours, reduce her stress and make a profit. But sh
kondaur [170]
C would not be a beginner move.

hope it helps
6 0
3 years ago
If you want to refine your Google search results by date, which option should you use?
just olya [345]
Try using ctrl, shift, delete
7 0
3 years ago
Jeremy has created a snippet of JavaScript. Which event handlers will he use to invoke JavaScript from his HTML form?
riadik2000 [5.3K]

Answer:

One of them is OnClick, but there are more.

Explanation:

I took my post test and only clicked OnClick and I missed this one and it says "not all correct answers chosen"

3 0
2 years ago
Read 2 more answers
The ________ is the agreed-upon interface between all the software that runs on the machine and the hardware that executes it. I
Talja [164]

Answer:

The correct answer to the following question will be "Instruction set architecture".

Explanation:

The Instruction Series Design is a component of the system that is accessible to the compiler and the programmer. It is also the distinction between hardware and software. We will describe in detail the set of instructions used in most of the microprocessors that are used today.

The processor ISA can be represented using 5 categories, these are as follows:

  • The RAM Running Memory.
  • Amount of clear operating names.
  • Location of operands.
  • Operations
  • Size and type of the operand.

Therefore, Instruction set architecture is the right answer.

4 0
2 years ago
Other questions:
  • Drivers dealing with strong emotions may take risks they otherwise would not. <br> true false
    15·1 answer
  • How to copy single slide to powerpoint
    15·1 answer
  • Predictive coding software leverages .............................when experts review a subset of documents to teach the softwar
    15·1 answer
  • Explain three applications of data mining
    14·1 answer
  • Why is the ketboard calledQWERTY
    11·2 answers
  • What are some good digital habits?
    5·2 answers
  • Which of the data repositories serves as a pool of raw data and stores large amounts of structured, semi-structured, and unstruc
    9·1 answer
  • What happens when a user clicks Accept on a meeting request?
    9·2 answers
  • Consider the following method.
    14·1 answer
  • PLS HURRY <br> Look at the image below
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!