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

  Linux advanced server vs windows 2003 server

Please give me 10 topic examples that I can select to write about in my class assignment. The example must be able to cover the directions that are listed below.

  Explain the risks and benefits of virtualization

How would you recommend that your IT department prepare for disaster.

  Providing overview of lane

Describe in scholarly detail an overview of the LANE and explain its place in an organization's network strategy. Answer should be of 300 words and also provide reference.

  Http frame

Assume an HTTPS page links to an HTTP iframe where two are loaded from several origins. Should the browser display a warning dialog? If so describe why. If not, describe why not.

  Generate a context diagram of the system

Generate a context diagram of the system

  Tradeoff between breath first search, depth-fisrt-search

tradeoff between Breath First search, Depth-Fisrt-Search.Directed Acyclic Graphs(DAGs), Topological sorting and Dijkstra.

  Implementing model to check the vulnerability

Construct a simple threat model which explains the risk this represents: attacker(s), vulnerability, assets, attack vector, and the likelihood of occurrence, likely impact, and the plausible mitigations.

  Problems in networking is the lack of enforceable standards

Both the engineering and the front office areas will use 100BaseT (twisted-pair Ethernet), how may you interconnect those two areas.

  Information security

What skills are required by personnel working in the information security? State some job titles in field and come up with some required qualifications and some desirable qualifications.

  Why x3d is currently replacing vrml

X3D is currently replacing VRML as the nearest the internet gets to Virtual Reality currently. Is X3D suited specifically to certain applications over others? consider an application for the Internet where you believe Virtual Reality would be of b..

  What are the major issues with wi-fi in homes

What are the main differences between Wi-Fi, Wireless and 3G? What are their advantages and disadvantages. What are the main issues with Wi-Fi in homes?

  Explaining the 4g lte

In January 2012, Verizon stated that the 4G LTE is available in the 190 cities covering around 200 million American subscribers. In accordance with the AT&T’s Website.

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