Question
Note: i have already done this practice assignment, and just need some quick help intro to C++ practice project. I would appreciate all help on
Note: i have already done this practice assignment, and just need some quick help
intro to C++ practice project. I would appreciate all help on this so that i may study it for my exam
============================
This is the unsorted_media.txt: (https://pastebin.com/mnXXmnAy its a bit lengthy so i put it on pastebin) but if you dont want to go to paste bin, here are all of the format examples from the unsorted_media.txt
The whole thing is like 3000 long but here are examples all of the different formats used
============================
12_Years_a_Slave_(2013).mp4 13_Going_on_30_(2004).mkv What's_Left_Of_Me_-_Bon_Jovi.mp3 130422_120414.jpg 2_Fast_2_Furious_(2003).m4v 20130424_125422.bmp 20130424_125427.gif 20130424_125445.tiff 20130424_125438.png 20130424_142647.jpg 21_Jump_Street.en.forced.srt A_Christmas_Carol_-_George_C_Scott_(1984).avi desktop.ini desktop.ini desktop.ini Kill_the_Lights.wma
============================
'
And this is the same output(what its supposed to look like)
Here is the final code, but i was wondering if it was possible to do this without cstddef and bits/stdc++.h (i would prefer it if it was pulled from the resource file folder on visual studio)
#include
/*function to get type of file i.e. extention of file*/ string gettype(string name) { string last; size_t index = name.find_last_of("."); last=name.substr(index+1); return last; } /*function to count totla files */ int count_data() { ifstream in; in.open(FILE_PATH); char temp[100]; int count=0; while(!(in.eof())) { in.getline(temp,100); count++; } in.close(); return count; } /*function to display report*/ void display_report(int all_,int movie_,int music_,int image_,int error_) { cout Unit 7: Programming CSIS 123 Programming Fundamentals: The purpose of this lab is to practice some string operations, to reinforce using functions, and to reinforce control statements from previous chapters. The media server project is going well, however the volume of files exceeds what a person could reasonbly click through one at a time. To practice an automated task, your friend asks if it is possible to evaluate and sort thousands o f es H me w hou user interven on our friend would like o see ? repor1 hal dern ns rales tie number of f les o evaluate, and he end resu c un ln each repository Your file of media is here unsorted media txt Your program should: Display to the user the total number of media files in an unsorted text source .Determine by media file format which source destination to write the media file Display a report of each source text file name, and the tolal number of files in that source . The program should take no user intervention, however "Press any key to continueis allowed . The program should utilize a minimum of FOUR defined functions Constraints .Do not use any concepts beyond the current chapter, unless explicitly stated in the tasks below Hint: Each individual function should perform only one funcion . You may call a function trom within a function . You should use a string value to represent the file name, instead of hard-coding example string media "unsorted_media.bxt" file_input.open(media) Task 1: Setup Variables 1. Add "unsorted_media.txt", "movies.txt","music.txt", images.txt","error.txt" to the resource files folder 2. Use preprocessor directives to include input/output, file inputoutput, string variables, and manipulators 3. Declare string variables for each item in Task 1.1 4. Declare int variables to hold a count value for each ilern in Task 1. 5. Declare a single string variable to hold the current item from the input stream 6. Separate Task 1 from Task 2 by pressing ENTER on your keyboard. This provides a single line of whitespace in your code Unit 7: Programming CSIS 123 Programming Fundamentals: The purpose of this lab is to practice some string operations, to reinforce using functions, and to reinforce control statements from previous chapters. The media server project is going well, however the volume of files exceeds what a person could reasonbly click through one at a time. To practice an automated task, your friend asks if it is possible to evaluate and sort thousands o f es H me w hou user interven on our friend would like o see ? repor1 hal dern ns rales tie number of f les o evaluate, and he end resu c un ln each repository Your file of media is here unsorted media txt Your program should: Display to the user the total number of media files in an unsorted text source .Determine by media file format which source destination to write the media file Display a report of each source text file name, and the tolal number of files in that source . The program should take no user intervention, however "Press any key to continueis allowed . The program should utilize a minimum of FOUR defined functions Constraints .Do not use any concepts beyond the current chapter, unless explicitly stated in the tasks below Hint: Each individual function should perform only one funcion . You may call a function trom within a function . You should use a string value to represent the file name, instead of hard-coding example string media "unsorted_media.bxt" file_input.open(media) Task 1: Setup Variables 1. Add "unsorted_media.txt", "movies.txt","music.txt", images.txt","error.txt" to the resource files folder 2. Use preprocessor directives to include input/output, file inputoutput, string variables, and manipulators 3. Declare string variables for each item in Task 1.1 4. Declare int variables to hold a count value for each ilern in Task 1. 5. Declare a single string variable to hold the current item from the input stream 6. Separate Task 1 from Task 2 by pressing ENTER on your keyboard. This provides a single line of whitespace in your code
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