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

  Assembly program to find out the price of a car rental

Write down an Assembly program in order to find out the price of a car rental. The car being rented costs $45 per day and frequent renters get a $15 discount on the total bill.

  Which references source page fault with lru page replacement

Which references source a page fault with LRU page replacement policy? Illustrate your intermediate working in table below with three columns.

  Cashregister requires to support a method void undo()

imagine the CashRegister needs to support a method void undo() that undoes the addition of the preceding item. This enables a cashier to quickly undo a mistake. What instance variables should you add to the CashRegister class to support this modif..

  How to use ms access and create a database

How to use MS Access and create a database

  How to establishing a secure computer room

Include the principles of separation of duties to find out who should be granted access into the computer room and the type of access they should have.

  Prepare a use case diagram

Prepare a Use Case Diagram based on the given problem description.

  Disadvantages are there to dereferencing of pointer

What drawbacks are there in implicit dereferencing of pointers, but only in certain contexts? For example, consider the implicit dereference of a pointer to a record in Ada when it is used to reference a record field.

  Explaining the rsa

Using the RSA with p = 3, q = 11, e = 7: Explain the suitable value for d? Encode the message “cat” by encrypting each letter separately, i.e., by encrypting ASCII code of each letter.

  Designing the calculator program

Develop a calculator program which will subtract, add, multiply, or divide two numbers input given by a user. If user selects division, do not permit the user to divide by 0

  Employeeexception class whose constructor receives a string

build an Employee class with two fields, idNum and hourlyWage. The Employee constructor requires values for both fields. Upon construction, it throw an EmployeeException if the hourlyWage is less than 6.00 or over 50.00. Save the class as Employee..

  Application showing files name-size and last modifiaction

Make a file by utilizing any word-processing program or the text editor. Write down an application which shows the file's name, size, and time of the last modification.

  Program declaring an integer variable

Write down a complete program that declares an integer variable, reads a value from keyboard into that variable.

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