Suppose that it is the largest number so far

Assignment Help Computer Engineering
Reference no: EM1331627

Create a program to determine the largest number out of 15 numbers entered (numbers entered one at a time). This should be done in a function using this prototype:

double larger (double x, double y);

Make sure you use a for loop expression inside your function.

Enter 15 numbers
11 67 99 2 2 6 8 9 25 67 7 55 27 1 1
The largest number is 99

Hints:

* Read the first number of the data set. Because this is the only number read to this point, you may assume that it is the largest number so far and call it max.
* Read the second number and call it num. Now compare max and num, and store the larger number into max. Now max contains the larger of the first two numbers.
* Read the third number. Compare it with max and store the larger number into max.
* At this point, max contains the largest of the first three numbers. Read the next number, compare it with max, and store the larger into max.

Repeat this process for each remaining number in the data set using a for expression.

Write a program using a function and a switch statement. The user should be prompted to enter a number in main. The function is called and the number entered is passed to the function. This function parameter will then be used in a switch to discover and print out the number word within the function (for example, 1=one, 2=two, 3=three, etc.).

Enter a number: 1
You entered the number one.

You may choose to limit the number entered by the user to a particular range. Be sure to prompt the user with this range, so you can deal with correct and incorrect numbers entered.

Reference no: EM1331627

Questions Cloud

Illustrate what effort does the principal want to induce : Illustrate what effort does the principal want to induce when effort is not observable. Illustrate what is the optimal contract for the principal.
Imagine that a doubly linked list "header" : Assume that a doubly linked list "header" stores the elements of a priority queue. make use of the function pop(), which deletes the element with the largest value from the list (priority queue).
Explain legal and regulatory ramifcations : What are the legal and regulatory ramifications of operating an e-Business?
Preparing the informational report : Choose one reason "doctors get sued" from the article above and let this be the basis of your presentation.
Suppose that it is the largest number so far : make a program to determine the largest number out of 15 numbers entered (numbers entered one at a time). This should be done in a function using this prototype.
Assume a indiidual has spend only on apples : Assume a indiidual has $8 to spend only on apples and bananas.
The collapse of centrally planned economies : Discuss the four factors that contributed to the collapse of centrally planned economies.
Describe examples of ethical problems : Health care providers are obligated to provide for those entrusted in their care. To what extent do they meet this obligation? How might their obligation to others conflict with their obligation to themselves?
Reduce the risk of loss from natural or unnatural disasters : What should a company do to make sure their data is in enough disperse locales to reduce the risk of loss from natural or unnatural disasters?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Translate following c++ program to pep/8 assembly language

Translate following C++ program to Pep/8 assembly language

  How do i build a sample cmm model

What is the needs for relevant quality standards and quality management.

  What are values of sum1 and sum2

If the operands in expressions are evaluated left to right. If the operands in the expressions are evaluated right to left? Sum1=48, Sum2=46

  A java application that can hold five doubles in a array

Write down a Java application that can hold five doubles in an array, and display the doubles from first to last, and then display the doubles from last to first. Use the following logic for BubbleSort to sort and display the array in sequence.

  Security vulnerability

What is the security vulnerability of this solution

  Why vista a better choice for home or office computing

Investigate net for information about some of the new features offered by Vista over previous operating systems or operating systems on other computing environments.

  Provide a java class named "input"

Provide a Java class named "Input" containing the method "readInt" (prototype given below) that displays the prompt string, reads an integer, and tests either it is between the supplied minimum and maximum. If not, it prints an error message and r..

  Recoginizing the error in given code

Identify the problem in the above code, If ( toupper( response[ 0 ] ) == 'Y' )

  What is a backup strategy or active directory?

What is a backup strategy or Active Directory? The small business that you created new domain controllers for now wants you to develop a backup and recovery plan for Active Directory.

  Declare three variables as integer

Log in to the Linux system as a user, and then open a Terminal emulation window.

  Global economy

Explain why is the global economy so vital today? Explain how the global economy has altered since the mid-twentieth century.

  Assigning the link password

Bob has forgotten his password. Allocate him a password of LINK and require that the Bob change his password next time he logs on.

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