i need an expert in c++

profileosama001100
161-Assign05.pdf

Western Oregon University Page 1 of 1

CS-161 Lab #5

General Submit this lab using the Moodle system by the beginning of lab on the due date.

 Use the Attach File tool to attach your .cpp file with your solution. It MUST be named exactly as specified in each problem. Do not attach any other files.

 Each code file should have the standard comment at the top (see assignment 1).

 Read information into all programs in the specified order. Do not ask for extra input. If a program says something like “ask the user for their name and the number of hours they worked” you MUST read in the name first, then the number of hours and not prompt for any other input.

 Readability and maintainability of your code counts. Poor formatting, confusing variable names, unnecessarily complex code, etc… will all result in deductions to your score.

Assignment Instructions Filename : assign5.cpp (This is the file name you MUST use for the file you submit for this problem.) Write a program that extracts information from a text file containing information about images on a website. Your program should read from a file called Images.txt which will consist of an unknown number of lines. Each line consists of an image URL (web address), an MD5 hash identifying the image, and a file size in bytes. Here is what a line might look like: http://smugmug.com/thumbs/Lacus.jpeg?170x330 44cf8edbd53cf75be874604b39a7694c 21990 Note that the URL consists of “http://smugmug.com/thumbs/” followed by a filename (“Lacus.jpeg”) including extension, then a question mark and the width (170) and height (330) of the image. A sample data file is provided below this assignment link named Images.txt Note that this file has 5 lines, but when I test your program I will not use this exact file. You cannot count on there always being exactly 5 images. The file will end with an empty line (like the sample file). Make sure to test your program with more/less lines than 5. Your program should print out an organized table that for each image shows: the filename, image type (the file extension), the width, the height and the size in kB (1024 bytes in a kB) rounded to one decimal place. It should then display the total size in kB of the images. Something like: Name Type Width Height Size Lacus.jpeg jpeg 170 330 21.5 Vel.jpeg jpeg 300 220 10.4 ElementumNullam.png png 270 280 58.6 MontesNasceturRidiculus.jpeg jpeg 180 220 101.5 AtLorem.jpeg jpeg 200 240 21.6

Total Size: 213.6

Hints:

 Remember, my test file will have a different number of lines.

 You should not need to turn strings into numbers, but if you do, here is how to do so: string foo = "123"; int x = stoi(foo); //convert string to int string bar = "123.5"; double y = stod(bar); //convert string to double

Make sure that you read the right input file name. Capitalization counts! DO NOT USE A HARD CODED PATH to a particular directory like: "C:\Stuff\Images.txt" Your code must open a file that is JUST called " Images.txt" Do not submit the test file, I will use my own.