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

  Research report on software design

Write a Research Report on software design and answer diffrent type of questions related to design. Report contain diffrent basic questions related to software design.

  A case study in c to java conversion and extensibility

A Case Study in C to Java Conversion and Extensibility

  Create a structural model

Structural modeling is a different view of the same system that you analyzed from a functional perspective. This model shows how data is organized within the system.

  Write an report on a significant software security

Write an report on a significant software security

  Development of a small software system

Analysis, design and development of a small software system.

  Systems analysis and design requirements

Systems Analysis and Design requirements

  Create a complete limited entry decision table

Create a complete limited entry decision table

  Explain flow boundaries map

Explain flow boundaries map the dfd into a software architecture using transform mapping.

  Frame diagrams

Prepare a frame diagram for the software systems.

  Identified systems and elements of the sap system

Identify computing devices, which could be used to support Your Improved Process

  Design a wireframe prototype

Design a wireframe prototype to meet the needs of the personas and requirements.

  Explain the characteristics of visual studio 2005

Explain the characteristics of Visual Studio 2005.

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