Programming Challenge 9
Description
Using only data structures and algorithms (with lambdas) from the standard library (no loops or named functions), perform the following:- Generate 1,000,000 random doubles in the range [0,1].
- Copy elements less than 0.3 or greater than 0.6 into another data structure.
- Transform these elements by rounding into integers in another data structure.
- Sort the integers in reverse order.
- Count (and output) the number of ones and number of zeroes.
Details
- Name the files and program
lambda_practice.cpp
. - In your top file comment, tell me the most confusing aspect to lambdas.
General Instructions, Turning in assignments, and Grading
General Instructions
- Name each file and program as listed in the instructions.
- The top of each program should have a comment block where the first line
is your name and following lines are a description of your program and
references used in programming.
//Name: Jory Denny
//This program debates Batman vs Superman!
//References:
// - Ref 1. - Follow turn-in instructions precisely.
- Failure to complete any of these steps will result in an incomplete.
Turn in Instructions
Each assignment will be turned in through GitHub classroom. Please find the link to create a repository at the top of this page, or through this link. Assignments are due BEFORE, let me repeat, before class starts. This does not mean five minutes after class starts.
- Soft copy (Online submission)
- Accept the invitation to the classroom assignment, which creates your repository on GitHub.
- Clone this repository, which includes some starting files.
- Add assignment files (stage, commit, push).
- Modify the Coverpage.txt file to provide name, sources, signature of following the honor code, etc. Be sure to stage, commit, and push these changes as well. If you do not fill out the coverpage, I will not grade the assignment.
- After the due date, I will clone your repository and add a grade and comments as necessary. After which you can pull these changes for your records.
Points
- Each assignment is a completion grade. In order to receive a completion, the code must compile and all parts of the challenge need to be completed.
- Note - a compiling, correct program ≠ 100%, just like a composed paper with the minimum requirements discussed ≠ 100% for an English Writing class.
- If there are any discrepancies in grades please see the instructor during his office hours or by appointment (do not discuss with the lab assistants or graders).