Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include #include using namespace std; int main(int argc, char const *argv[]) { string a[] = {Pineapples, Show strings, Drill bits, USB drivers, Toothpaste}; int count[5]
#include#include using namespace std; int main(int argc, char const *argv[]) { string a[] = {"Pineapples", "Show strings", "Drill bits", "USB drivers", "Toothpaste"}; int count[5] = {0}; while (true) { int c; cout > c; if (c == 6) break; count[c - 1] += 1; } fstream newfile; newfile.open("out.txt", ios::out); if (newfile.is_open()) { for (int i = 0; i B.) Using the function printThings, print out (cout) the file from your myOstream updates in part A. Print the results as item, and count. Make sure you show all of the the items. C.) Download the file on Brightspace called readIt.txt. It should be located where you found this document. This file contains numbers. Here is what is in this file: 456 776 99 3 765 433 211 994 609 65 4 Write the function readNumbers that reads this file until the end, adds each amount to a total, counts up all of the records, and when complete displays "The total numbers: XXX" on one line and "The number of records: xxx" on another line. We coded the part to close the file for you. B.) Using the function printThings, print out (cout) the file from your myOstream updates in part A. Print the results as item, and count. Make sure you show all of the the items. C.) Download the file on Brightspace called readIt.txt. It should be located where you found this document. This file contains numbers. Here is what is in this file: 456 776 99 3 765 433 211 994 609 65 4 Write the function readNumbers that reads this file until the end, adds each amount to a total, counts up all of the records, and when complete displays "The total numbers: XXX" on one line and "The number of records: xxx" on another line. We coded the part to close the file for you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started