Answered step by step
Verified Expert Solution
Link Copied!

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]

image text in transcribed

#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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

Students also viewed these Databases questions

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago