100% Guaranteed Results


Engineering-Computation – Homework 6 Solved
$ 24.99

Description

5/5 – (1 vote)

50 points
NE 4499/5599
CS 4499/5599
Computational Engineering with C++
Dr. Leslie Kerby

2. Find the total current value of all 10 Trucks. Use accumulate, a lambda function, and the method getValue(). Print the total to the screen with text explaining it is the total.
3. Find the total estimated value in 5 years. Find the estimated value of all 10 trucks in 5 years, using the estimateVal() free function. Then use accumulate to find the total future value of all 10 trucks (the returned future_vals float vector). Print it to the screen with an explanation.
4. Create a print method within the Truck class. First create a Truck getter method called getName() which returns <Year> + <Manufacturer> + <Model> + <4×4–if it has it>. Use the ternary (or immediate if) operator to decide what to print for the 4×4. Then create a print method called printTruck() and give it the appropriate type. Have it print getName().
5. Sort your 10 Trucks alphabetically. Sort by getName(). Use a lambda in the sort method. Using a ranged for loop, print out your 10 sorted Trucks using printTruck().
6. Now sort your vector of 10 Trucks by mileage. Make sure to keep the alphabetical getName() order in the case of identical mileage. Again print out the Trucks.

Attach your source code, screenshots of output, and header (if used) files. Include compiled executables if you wish.

Reviews

There are no reviews yet.

Be the first to review “Engineering-Computation – Homework 6 Solved”

Your email address will not be published. Required fields are marked *

Related products