Write a program using a function and a switch statement

Assignment Help C/C++ Programming
Reference no: EM13936851

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: EM13936851

Questions Cloud

Zone of acceptance for a product or category : In what way might deal sites affect the zone of acceptance for a product or category? What are the implications for marketers?
Knowledge about the programming language c : The above segment descriptor describes a memory segment in terms of its start address, its size and whether it is ALLOCATED or FREE. This descriptor is part of a list (contains a pointer to next segment descriptor). Initially, there is only one se..
Do you agree with jules balles range-touts financial control : Do you agree with Jules Ballès, Range-Tout's financial controller, that the supplies purchased from Génie du Bois SA were accounted for improperly? Explain your answer.
Consumer behavior attitude about luxury brands : Looking for a reliable assignment service provide to provide me with an urgent 5 pages report On Consumer behavior attitude about luxury brands.
Write a program using a function and a switch statement : 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 disco..
Software tools for managing and analyzing qualitative data : Craft a 3- page paper and 5 references in which you do the following: Compare and contrast software tools for managing and analyzing qualitative data
Design your own test program to test the modification. : Add method Modify(int id, char*, char*, float, char*) to modify the id's record. If such id not exist, add it as a new record into the list
Ethical and consumer behaviour issues : Identify any ethical and consumer behaviour issues you feel are not currently being adequately addressed (or are ineffectively addressed) by the current campaign.
Parameters and to allocate local variables : The aim of this practical is to make you more familiar with calling sequences which use the stack both to pass parameters and to allocate local variables. Calling sequences are very important, as is stack management.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a recursive method to print all the permutations

Write a recursive method to print all the permutations of a string.

  Code to implement a staque

Write a C++ code to implement a Staque. Since the data structure is all about inserting and deleting numbers, it would be a good option to use a linked list to implement Staque.

  Write an automated checkout program to expedite customers

A local department store hires you  to write an automated checkout program to expedite customers in a hurry. The  checkout line can only accept five items for any one purchase

  Define the term root-to-leaf path in detail

My goal, given a binary tree and a sum, is to return true if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. Returning false if no such path can be found.

  Function called timesten that returns back

Write a function called timesTen that returns back to the caller the value passed into the function multiplied by 10. If the value passed into the function is negative, the function also returns the string

  Program of a class date which displays the date

Write a C++ program of a Class Date which displays the date. Use the subsequent requirements:

  How do you make a row with different string names

How do you make a row with different string names and put a certain amount of space between each one?

  Write function to find whether number is perfect number

Write down the function perfect which determines whether number is perfect number or not. This function must receive number and return true if number is perfect.

  Determine the letter grade associated with the average

Create a loop structure to display and calculate the factorial of the larger number provided by the user - What if these were test scores? Calculate the average of the two numbers provided.

  Advanced programming techniques

Joe has joined FIT technologies recently as a software developer. He is a fresher and does not know advanced programming techniques. To include him in the team that is developing the application, Damien, the Project Manager, decides to conduct a t..

  Rewrite the code- buid the linked list without dummy node

Rewrite the code- buid the linked list without dummy node

  Csc302 make any dfa in jflap software and run for several

make any dfa in jflap software and run for several inputs. take a screen shot and include in your assignment. keep in

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