Write a simple program to determine the difference between


1. Write a simple program to determine the difference between the largest and smallest element in an array of size 10. Your program should ask the user to fill in the elements of the array. Your program should use only pointer variables and dynamic memory except for the array. For example, even an index variable in a loop must be a pointer variable. Note that your array should be able to accommodate real numbers as well as negative numbers. A sample run of the program is given below.

Please input the array values
5 -1 3.4 5 -6.7 9 10 100 4 -9.1
Largest value: 100
Smallest value: -9.1
Difference: 109.1

2. Write a C++ program called hw2_2_yourlastname.cpp that draw a diamond as the sample execution below. In the program, you can assume that the number given by a user is always valid (= positive number). In the program, you must use only pointer variables and dynamic memory. [For instance, even an index variable in a loop must be a pointer variable]. A sample run of your program should be like below:

Enter a number: 5
*
***
*****
*******
*********
*******
*****
***
*

This is another sample run of your program:
Enter a number: 3
*
***
*****
***
*

Request for Solution File

Ask an Expert for Answer!!
Software Engineering: Write a simple program to determine the difference between
Reference No:- TGS0920807

Expected delivery within 24 Hours