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
Write the following program in C++ to print:
Alenkinab [10]
1.
#include <iostream>#include <string>
using namespace std;
int main(){    string chars; // This is where we will put our @ signs and print them    for(int x=0;x < 5; x++){
        chars = chars + '@'; // This will concatenate an @ sign at the end of the variable        cout << chars << "\n";    }}

2.
#include <iostream>#include <string>
using namespace std;
int main(){    string name; // Our variable to store the name    cout << "What is your name? \n"; // Asks the user for their name    cin >> name;    cout << "\nWell, hello " << name << "!";}

3.
#include <iostream>#include <string>
using namespace std;
int main(){    int number; // Our variable    cout << "Enter a number\n"; // Asks for a number    cin >> number;    cout << "You entered " << number << "%!";}

4.
#include <iostream>#include <string>
using namespace std;
int main(){    int number; // Our variable    cout << "Enter a number\n";    cin >> number;
    int check = number % 2; // The modulo operator (the percent sign) gets the remainder of the quotient    if (check == 0) {        cout << number << " is even!"; // If the remainder is 0 then it prints out "x is even"    } else {        cout << number << " is odd!"; // If the remainder is not 0 then it prints out "x is odd"    }}

5.
#include <iostream>#include <string>
using namespace std;
int main(){    float r; // Our variable    cout << "Enter a radius\n";    cin >> r;    if (r < 0){        cout << "Lol. No."; // If the radius is less than zero print out that message    }    float circumference=2*3.14*r;    float area=r*r*3.14;    cout << "\n\n Circumference of circle: " << circumference;    cout << "\n Area of circle: " << area;}
4 0
3 years ago
An attacker has obtained the logon credentials for a regular user on your network. Which type of security threat exists if this
jarptica [38.1K]

Answer:

privilege escalation.

Explanation:

An access control can be defined as a security technique use for determining whether an individual has the minimum requirements or credentials to access or view resources on a computer by ensuring that they are who they claim to be.

Simply stated, access control is the process of verifying the identity of an individual or electronic device. Authentication work based on the principle (framework) of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.

Basically, authentication and authorization is used in access control, to ensure a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification

Hence, an access control list (ACL) primarily is composed of a set of permissions and operations associated with a user account or new technology file system (NTFS) file such as full control, read only, write, read and execute and modify.

In this scenario, an attacker or hacker was able to obtain the logon credentials for a regular user on your network. Thus, the type of security threat which exists if this user account is used by the attacker or hacker to perform administrative functions is privilege escalation.

Privilege escalation can be defined as a network or security threat which involves the exploitation of a design flaw, bug or unsecured configuration settings in a software program (application), operating system (OS), computer system, etc., so as to have an unauthorized access and gain more permissions, elevated rights or privileges that are normally protected from a user account or software program.

Hence, when an attacker or malicious user such as a hacker gains an unauthorized access to the privileges of another user account beyond what is intended or entitled to a user, it is known as privilege escalation.

6 0
3 years ago
What was the name of the first computer (machine) language?
Angelina_Jolie [31]

In 1957, the first of the major languages appeared in the form of FORTRAN. Its name stands for FORmula TRANslating system. The language was designed at IBM for scientific computing. The components were very simple, and provided the programmer with low-level access to the computers innards.


8 0
3 years ago
Read 2 more answers
The rules and guidelines for appropriate computer mediated communication are called?
irinina [24]
<span>The rules and guidelines for appropriate computer mediated communication are called netiquette. 
It is a blend of two words: net (from Internet) and etiquette, or the appropriate behavior. 
</span>
4 0
3 years ago
What are the advantages of wired networks?
lesya [120]

Answer:

1   2    4

Explanation:

6 0
3 years ago
Other questions:
  • Which of the following is a goal of paraphrasing and summarizing?
    14·2 answers
  • The ____ shortcut keys remove character formatting. (points : 2) ctrl 0 (zero) ctrl i ctrl spacebar ctrl u
    8·2 answers
  • What is zenmap typically used for? how is it related to nmap? describe a scenario in which you would use this type of applicatio
    14·1 answer
  • How to transfer photos from iphone to computer
    14·1 answer
  • Movies may depict larger-than-life situations, such as calamities, superheroes, and spaceships. A helps show such extraordinary
    11·1 answer
  • Write a method reverse( ) for OurLinkedList class. The method should return a new OurLinkedList object that is the reverse of th
    8·1 answer
  • 1. Write the full forms of the following.
    8·2 answers
  • To print a square of star shaoe we use the following code:
    10·1 answer
  • QUESTION 5
    9·1 answer
  • Can someone give me an earsketch song of summer to turn in
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!