Write down an algorithm that returns the smallest value

Assignment Help Computer Engineering
Reference no: EM1331356

Using the following Array,

S = { -55.985, 14.75, .00049, 35.42, -.00049, 883.03, 19.03 }

use code (the language of your choice) to write a program to do the following Exercises

Problem 2 : Write an algorithm that returns the smallest value in the array. Use a for loop

Problem 3: Write an algorithm that outputs the largest ans second largest values in the array.

Problem 4s : Write an algorithm that outputs the smallest and second smallest values in the array.

Problem 5: Write an algorithm that outputs the smallest and largest values in the array.

When you write your program, you can let one program do all of the problems (as opposed to writing four separate programs) by using a separate function/method to handle each of the problems listed above (e.g., a method named "probFour( )" to do Exercise 4s, and a method named "probThree()" to do problem 3, etc.)

Program Output:
Have your program output the answers as follows:

Answer to Problem 2: blah, blah
Answer to Problem 3: blah, blah

Reference no: EM1331356

Questions Cloud

Explain how much utility will the marginal dollar yield : Explain how much utility will the marginal dollar yield.
Prepare a project plan that covers all project groups : Prepare a project plan that covers all project groups and knowledge areas and Prepare project plans that integrate project procurement and contracting activities across project groups
More hours or fewer when offered a higher hourly salary : you select to work more hours or fewer when offered a higher hourly salary.
Creation of an evaluation system : Explain how you would proceed with the creation of an evaluation system and List the types of intervention you would design and ask the company to implement to address this issue.
Write down an algorithm that returns the smallest value : Write down an algorithm that outputs the smallest and second smallest values in array.
Explain how a voluntary exchange result : Explain how a voluntary exchange results in a win/win situation to both parties.
Indicators of strategic hrm effectiveness : Indicators of strategic HRM effectiveness - Find an article through ProQuest that discusses the proposition that HRM adds value to the firm.
A strong behaviorist approach to learning focuses : A strong behaviorist approach to learning focuses on discrete tasks that are built up until they become a complex behavior.
Resource challenges and independent contractors : Resource Challenges and Independent Contractors - What are the negatives and positives when using independent contractors for projects

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write down an assembly language program

Write down an assembly language program The product number from one to five (3 characters wide, right justified)

  Characteristics of rdbms

Explain the characteristics of the Relational Database Management System (RDBMS).

  What are three goals of safety in computing?

What are three goals of safety in computing?

  Write down an expression that evaluates to true

Given variables isFullTimeStudent and age , write an expression that evaluates to true if age is less than 19 or isFullTimeStudent is true.

  Supply supporting evidence for the decision

Now that you have a normal plan and have identified the information that you need for this program, you feel you are ready to start development. You told your uncle that you would need to purchase software for this program. Since your uncle is in ..

  Program on string representing

Program on  string representing

  Find out the minimum-cost spanning trees

Find out the shortest paths from S to all the other nodes in the graph using Dijkstra Algorithm.

  The application must have at least one class

A salesperson can also receive a commission as a sales incentive. Commission is a percentage of the salesperson's annual sales. The current commission is 5 percentof total sales.

  Express what makes one algorithm better than another

A non-technical friend has asked whether some algorithms are better than others. express what makes one algorithm better than another.

  Contain reference slide with citations in apa format

build a 5- to 7-slide Microsoft?PowerPoint?presentation detailing the evolution of programming languages. Organize your slide presentation in the form of a timeline, and discuss the various generations of programming language.

  Addressing and naming model

Sketch a plan for development of the addressing and the naming model in an environment of following given scenario: Ten (10) departments in the 1,000-employee organization. Equal separation by geography

  Dtproperties and sysdiagrams

Exclude the tables “dtproperties” and “sysdiagrams”. List the column CountOfTable, in which the Table is the chosen table name.

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