Assignment 2

Assignment 2 - of the numbers stored in a...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Page | 1 Assignment 2 CSC1254/1, Fall 2011 A SSIGNMENT 2, CSC1254/1, F ALL 2011 Introduction to Programming with C++ II, Hartmut Kaiser http://www.cct.lsu.edu/~hkaiser/fall_2011/csc1254.html Due: Thursday, September 22, 2011 Submitted electronically: before 12:00 PM Accepted late: before September 23 rd , 12:00PM: -15% before September 24 th , 12:00PM: -30% Please submit each of the tasks below as a separate file, named task1.cpp , task2.cpp , etc. Create all of these files inside a new sub-directory called prog2 . All files will have to be submitted in one step by invoking the submission command as described in the document ‘Submitting homework (Assignment 1, Appendix)’ available from the homepage. 1. ( 30% ) Write a program to report the length of the longest and shortest string in its input ( task1.cpp ). 2. ( 30% ) Write a program to calculate the average
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of the numbers stored in a std::vector<double> . ( task2.cpp ). 3. ( 40% ) Write a program to calculate the squares of int values up to (but not including) 100. The program should write two columns: The first lists the value; the second contains the square of that value. Use the manipulator std::setw 1 ) to manage the output so that the values line up in columns ( task3.cpp ). 4. Bonus: ( 40% ) Write a program to count how many times each distinct word appears in its input, generate a table with 2 columns, one column listing the word, the second column should list the number of occurrences of that word ( task4.cpp ). All of the programs have to be compilable and, when run, should do the expected things. 1 as described here: http://www.cplusplus.com/reference/iostream/manipulators/setw/ , or in the book in §4.6...
View Full Document

This note was uploaded on 12/29/2011 for the course CSC 1254 taught by Professor Blanks,l during the Fall '08 term at LSU.

Ask a homework question - tutors are online