--Originally published at Solving Problems with Programming
PICTURE OF ACTOR
So in this nine week class I started with doing this WSQ09. I started reviewing in creating and calling functions in C++.#Mastery06, #Mastery07, #Mastery16 Use of recursion for repetitive algorithms, #Mastery17 When to use what type of repetition in a program, #Mastery18 Creation and use of Arrays/ Vectors in C++.
Futhermore in this assignment we have two new mastery topics covered #Mastery19 Creation and use of strings and #Mastery21 Reading and writing of text files.
What I did for this numeric program is solving the problem to the user by writing a function that receives as parameter the name of a file (this would be a string value like data.txt) and this function counts the number of lines and the number of characters in the file which it returns as a single value (but with two values). I will want to look at how to create/define and return a struct value from a function and how to open and read text files line by line.
Hence, the resources I need it to solve this program are here:
ken bauer
C++ Tutorial for Beginners 43 – How to Read from a .txt file using C++
The following photograph shows the solution to this problem:
Picture of author
So at first I wrote the same structure of the program just did the same as what i did in Hello World: Second Class, Second Blog (Blog of the second class 12/01/17) and Hello World.cpp, #WSQ01 Post Fun with Numbers 16/01/17 and WSQ1.cpp, #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp, #WSQ03 Post Pick a Number 23/01/17 and WSQ03.cpp, #WSQ04 Post Sum of Numbers 23/01/17 and WSQ04.cpp, #WSQ05 Six Tutorial On To Functions 12/02/17 and WSQ05.cpp, #WSQ06 Factorial Continue reading "#WSQ09 Multipart Data and Files 10/03/17 and WSQ09.cpp"