Use C++ to read data from a text file and create an array of numbers. Use the C++ 'fstream' library functions to open, read and close a text file. You can use the C++ 'iomanip' library to format your output and manage whitespace on your input. • Graduate students must create and write the data to a new text file. 2 Your assignment is to create a program that does the following: a. You will need to create a new file (you can do this in the file system – make it plain text) and call it mydata.txt. b. Put a column of numbers in the text file to read later. Pay attention to type – make them all have decimal points. In repl.it, use the numbers in my file. c. Based on the examples in the slides (L3) and the textbook, write a C++ program, include 'iostream' and 'fstream'. You might need 'iomanip'. d. Your program should read the numbers from the file into an array and print the array to the console in reverse order using a for loop. e. Graduate Students must also print the output to a new text file called output.txt. f. Follow Professional Standards: For details on how programming style, see the Programming Style Guide. Put your name in your program block comment at the top. Use logical variable names and function names – do not make me guess. Indent properly. Greet the user with the name of the program, and your name. Indicate that the program ended normally by saying Bye or thanking the user for using your program. Do not forget the block comments for each function. Use in-line comments as required. g. Optional Challenge for undergrads (required for Graduate Students): i. Print the output to a new text file called output.txt for an extra point.
Use C++ to read data from a text file and create an array of numbers. Use the C++ 'fstream' library functions to open, read and close a text file. You can use the C++ 'iomanip' library to format your output and manage whitespace on your input. • Graduate students must create and write the data to a new text file. 2 Your assignment is to create a program that does the following: a. You will need to create a new file (you can do this in the file system – make it plain text) and call it mydata.txt. b. Put a column of numbers in the text file to read later. Pay attention to type – make them all have decimal points. In repl.it, use the numbers in my file. c. Based on the examples in the slides (L3) and the textbook, write a C++ program, include 'iostream' and 'fstream'. You might need 'iomanip'. d. Your program should read the numbers from the file into an array and print the array to the console in reverse order using a for loop. e. Graduate Students must also print the output to a new text file called output.txt. f. Follow Professional Standards: For details on how programming style, see the Programming Style Guide. Put your name in your program block comment at the top. Use logical variable names and function names – do not make me guess. Indent properly. Greet the user with the name of the program, and your name. Indicate that the program ended normally by saying Bye or thanking the user for using your program. Do not forget the block comments for each function. Use in-line comments as required. g. Optional Challenge for undergrads (required for Graduate Students): i. Print the output to a new text file called output.txt for an extra point.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY