100% Guaranteed Results


Engineering-Computation – Homework 5 Solved
$ 24.99

Description

5/5 – (1 vote)

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

1. Warm up with pointers:
a. Create two integer variables named x and y;
b. Create an int pointer named p1;
c. Store the address of x in p1;
d. Use only p1 (not x) to set the value of x to 99;
e. Using cout and x (not p1), display the value of x;
f. Using cout and the pointer p1 (not x), display the value of x;
g. Store the address of y into p1;
h. Use only p1 (not y) to set the value of y to -300.
2. Updating Vehicle and Truck classes:
a. Take your Vehicle class from Homework 4 and add a private member variable ‘value_date’.
c. Add a getter method for value_date.
each year, but NOT update the value and value_date private members.
h. Don’t forget to update your const member functions (add const to those that don’t change member variables).
3. Vector of Trucks passed by (const) reference:
b. Create a global function called ‘estVal’ which takes a Truck vector const reference (const&) and a float const reference (const&). Note that the const is on the reference, not the vector or float. ‘estVal’ will return a float vector.
d. In the main function, print out the five estimated values calculated and returned by ‘estVal’.

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 5 Solved”

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

Related products