Largest and smallest element in an array

Assignment Help Software Engineering
Reference no: EM13667227

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
*
***
*****
***
*

Reference no: EM13667227

Questions Cloud

What is the amplitude of the magnetic field : An electromagnetic wave is traveling in +X direction. The amplitude of the electric field is 6.0 V/m. What is the amplitude of the magnetic field?
Determine the period of the motion : An electron with kinetic energy 1.40 keV circles in a plane perpendicular to a uniform magnetic field. Determine the period of the motion
What is the intensity of the transmitted light : When a beam of unpolarized light of intensity 2.4 X 10-4W/m  2 passes during a thin polarizing filter the transmitted light is linearly polarized in the direction 30 degrees from the x-axis. What is the intensity of the transmitted light?
What will be the length of the wire : Assume that you wish to fabricate a uniform wire out of0.950 g of copper. If the wire is to have a resistance R = 0.500, and if all of the copper is to be used. What will be the length of the wire?
Largest and smallest element in an array : Write a simple program to determine the difference between the largest and smallest element in an array.
Determine the young modulus for the relaxed muscle : A relaxed biceps muscle requires a force of 25.0 Newton for an elongation of 3.0 centimeter; the same muscle under maximum tension requires a force of 500 N for the same elongation. Determine the Young modulus for the relaxed muscle
Light string that passes over a pulley of moment of inertia : Two blocks of masses 2 kg and 3 kg, are linked by a light string that passes over a pulley of moment of inertia 0.004kg·m 2 and radius 5 cm. The coefficient of friction for the table top is 0.30. The blocks are released from rest. Using energy method..
Small planet has the similar density of the earth : Assume that a person can jump straight up a distance of 61 cm on the surface of the earth. How small would a planet have to be so that the person could jump totally off (i.e. jump up and not come down)? Suppose that Earth's radius is 6380 km and that..
What is the direction of the current in the wire : A 2.50 meter long copper wire has a mass of 0.25 kilograms. A magnetic field of 0.15 Teslas is oriented horizontally from south to north. What is the minimum current in the rod that would allow it to "float" in this magnetic field? What is the direct..

Reviews

Write a Review

Software Engineering Questions & Answers

  Answer the module review questions listed below these

1.answer the module review questions listed below. these questions were chosen to demonstrate your understanding and

  Write an report on a significant software security report

write an report on a significant software security. report should include details such as for example - the nature of

  Investigate examples of software failure and see if you can

investigate examples of software failure and see if you can discern any trends. is the failure-rate getting better or

  1who start to introduce 4ps2who used 4ps3a lot of

1who start to introduce 4ps?2who used 4ps?3a lot of researches used 4ps44ps also being used in the education5start to

  You are required to read the media release about

you are required to read the media release about franchising below and determine what are the key points of this

  Sketch the use case diagram for stillwater antiques

Sketch the use case diagram for the following circumstances Stillwater Antiques purchases and sells one-of-a-kind antiques of all kinds.

  Answer the following questions using apa style and citing

answer the following questions using apa style and citing at least one credible source per answer with in-text and

  Frame diagrams

Prepare a frame diagram for the software systems.

  Describe in a one to two 1-2 page narrative a use case

describe in a one to two 1-2 page narrative a use case complete with typical and alternate courses that documents the

  Create visual logic flow chart-calculate pay of employees

The user will then be able to continue calculating the pay for additional employees until the user decides to stop or until the maximum number of employees is reached. Create a Visual Logic Flow Chart.

  Create either pseudocode or flowchart for program

Create either pseudocode or a flowchart for a program that does the following: Prompt the user to enter a sales tax rate. Prompt the user to enter a price.

  What might be causing the slow response time

What might be causing the slow response time? Prepare a brief memo explaining system performance and workload measurement, using nontechnical language that Personal Trainer users can understand easily.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd