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
Data values in a program are held in _________. a data types b names c variables d lockers
Tpy6a [65]

Answer:

Answered below

Explanation:

Data values in a program are held in variables. Variables are like containers for holding different types of data. A variable can be identified depending on the kind of data it holds. Variables can hold data types of integers, strings, arrays, lists, sets, Boolean etc. They hold unique data types and a can not hold different data types. Different rules exist for naming variables in different programming languages. A variable name should start with lowercase letters and be descriptive of the data it holds.

7 0
3 years ago
Hi, Everybody i have a question it is almost my B-day i want this lego set
salantis [7]

Answer:

You can look at different websites of look on an app for people selling it, or something :p

Explanation:

3 0
3 years ago
Because assembly language is so close in nature to machine language, it is referred to as a ____________.
Travka [436]

Answer:

low-level language.

Explanation:

6 0
3 years ago
Read 2 more answers
Must be python format
Irina18 [472]

import random

to_guess = random.randint(1, 1000)

count = 0

guess = 0

while guess != to_guess:

   guess = int(input("Guess a number between 1 and 1000? "))

   while guess < 1 or guess > 1000:

       guess = int(input("Whoops, guess a number between 1 and 1000? "))

   count += 1

   if guess > to_guess:

       print("Your guess is too high! Try a lower number.")

   elif guess < to_guess:

       print("Your guess is too low!. Try a higher number.")

print("You got it! The number is " + str(to_guess)+" and you got it in " + str(count) + " guesses!")

I hope this helps!

7 0
2 years ago
What is the answer to this question?
Ivan

5

8

<u>Explanation:</u>

<u></u>

Since the number is already defined as 5, greater_than_zero holds the value true and less_than_zero holds the value false because 5 is greater than zero and not less than 0. Since there are 4 four if conditions, only two holds true i.e the first one and the last one because the in third condition we are using and logic which needs both condition to be true to make the condition true, whereas in fourth we are using or logic which can make condition true even if one condition is true. Hence the number printed will be number and number +3.

6 0
3 years ago
Other questions:
  • What is one way for an entrepreneur to decrease risk?
    8·1 answer
  • Approximately what percent of desktop PCs are used for work-related purposes?
    12·1 answer
  • How to see if your computer has bluetooth?
    6·1 answer
  • identify three ways we use analog and digital signals in our everyday lives. Describe how radio telescopes are used to explore s
    7·2 answers
  • Non-preemptive Shortest Job First (SJF) scheduling policy is not optimal if:
    7·1 answer
  • W t f is a ground fault circuit interrupter?
    6·2 answers
  • I really want to know the best way to deal as much heart as possible plz tell me
    7·2 answers
  • _____ is a problem-solving technique where each problem in a database is stored with a description and keywords that identify it
    10·1 answer
  • Saujani describes that women are highly underrepresented in STEM careersShe attributes this to women needing more confidence. Wh
    13·1 answer
  • Multiple Select
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!