Using online gdb do the following code, after its typed create a datafile and make sure the
Fantastic news! We've Found the answer you've been seeking!
Question:
Using online gdb do the following code, after its typed create a datafile and make sure the output is correct.
Transcribed Image Text:
tinclude ciostream> Binclude <fstream> einclude <iomanip> dinclude <string> Loading Libraries Allows data access from files using namespace std; ifstream datafile; Creates file object named datafile int main) datafile.open("Text.txt"); + Opens a datafile named Text.bxt for input string name; int num = 0, total = 0; cout << endl << endl; while (Idatafile.eof0) Checks to see if at the end of datafile Reads data from datafile >> name >> num; total += num; cout << right <e setw(8) << name <<<< left << setw(4) << num << enc datafile Into variables cout << endl << right << setw(8) << "Total" <<"<« setw(4) <« left << total <« datafile.close: + Closes datafile named Text.txt return 0; tinclude ciostream> Binclude <fstream> einclude <iomanip> dinclude <string> Loading Libraries Allows data access from files using namespace std; ifstream datafile; Creates file object named datafile int main) datafile.open("Text.txt"); + Opens a datafile named Text.bxt for input string name; int num = 0, total = 0; cout << endl << endl; while (Idatafile.eof0) Checks to see if at the end of datafile Reads data from datafile >> name >> num; total += num; cout << right <e setw(8) << name <<<< left << setw(4) << num << enc datafile Into variables cout << endl << right << setw(8) << "Total" <<"<« setw(4) <« left << total <« datafile.close: + Closes datafile named Text.txt return 0;
Expert Answer:
Answer rating: 100% (QA)
Online C Compiler Code Compile Run and Debug C program online Write you... View the full answer
Related Book For
Statistics for Business & Economics
ISBN: 978-1337094160
13th edition
Authors: David R. Anderson, Dennis J. Sweeney, Thomas A. Williams, Jeffrey D. Camm, James J. Cochran
Posted Date:
Students also viewed these accounting questions
-
Fundementals of Info Security 1. Create a text file using Notepad (or another text editor of your choice). 2. Type the name in the paremthsis in the file only (Sergio Villarreal): Please make sure of...
-
The ice cream market consists of both high- and low-quality product. High-quality ice cream is made with only natural ingredients (cream, sugar, real fruit) while low-quality ice cream is often made...
-
Create a presentation on "Small businesses without an online presence".
-
Explain, in your own words, what is meant by source inspection.
-
A sample space consists of four sample points S1, S2, S3, and S4, where P(S1) = .2, P(S2) = .1, P(S3) = .3, and P(S4) = .4. a. Show that the sample points obey the two probability rules for a sample...
-
Ritter Corporation's accountants prepared the following financial statements for year-end 2010: 1. Explain the change in cash during 2010. 2. Determine the change in net working capital in 2010. 3....
-
List and discuss the major information security and privacy threats to organizations.
-
What will be the nominal rate of return on a preferred stock with a $100 par value, a stated dividend of 8 percent of par, and a current market price of? (a) $60, (b) $80, (c) $100, and (d) $140?
-
Suppose you want to sell naked options on a bitcoin miner like MARA or RIOT. Could you hedge by also buying some bitcoin at a broker, or COINBASE? You would have to be very very explicit, showing a...
-
Kevin Brownis the management accountant at and Sons Bank. Some of his colleagues attended a conference recently where they learned that machine learning can be used to accurately predict loan...
-
You roll two dice. What is the probability of rolling a number greater than eight, for the following: a) No prior information is given b) One dice displays the number 5 ? c) One dice displays a...
-
Can you delve into the complex interplay between the gut microbiota and host immune system, highlighting the mechanisms by which commensal microbes shape immune development, tolerance, and...
-
Can you elaborate on the processes of somatic hypermutation and class-switch recombination in B lymphocytes, detailing their roles in generating antibody diversity and optimizing antibody-mediated...
-
discuss the intricacies of immune tolerance mechanisms, including central and peripheral tolerance induction, and their roles in preventing autoimmune reactions while preserving immune responsiveness...
-
discuss the concept of immune privilege in tissues such as the central nervous system, reproductive organs, and the eye, elucidating the mechanisms that maintain tissue-specific immunological...
-
What are the intricate molecular mechanisms underlying adaptive immunity, particularly focusing on the processes of clonal selection, antigen recognition by T and B lymphocytes, and the generation of...
-
X 5.2. FILE Paste 1. Determine the break-even point. 2. Compute the margin of safety and explain its significance. 3. Compute the degree of operating leverage at a particular level of sales and...
-
Let X be a random variable taking on values a1, a2, . . . , pr with probabilities p1, p2, . . . , pr and with E(X) = μ. Define the spread of X as follows: This, like the standard deviation, is a...
-
Is the number of square feet of living space a good predictor of a house's selling price? The following data show the square footage and selling price for fifteen houses in Winston Salem, North...
-
During the summer of 2014, Coldstream Country Club in Cincinnati, Ohio collected data on 443 rounds of golf played from its white tees. The data for each golfer's score on the twelfth hole are...
-
The Pew Research Center Internet Project, conducted on the 25th anniversary of the Internet, involved a survey of 857 Internet users (Pew Research Center website, April 1, 2014). It provided a...
-
Find the conditional distribution of happiness by marital status for the data in Table 9. Then draw a bar graph that represents the conditional distribution of happiness by marital status. Approach...
-
One growing concern regarding the U.S. economy is the inequality in the distribution of income. The data in Table 1 represent the distribution of household income for various levels of income in...
-
One growing concern regarding the U.S. economy is the inequality in the distribution of income. An economist wants to know if the distribution of income is changing, so she randomly selects 1500...
Study smarter with the SolutionInn App