C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter E, Problem E.7E
Program Plan Intro
- Include the required header files.
- Declare function prototype which is used in the program.
- Define the “main()” function.
- Define the 3 variables to take values from keyboard.
- Define 1 more variable to take the return value from the function.
- Make a call to the function MINIMUM3 which uses MINIMUM2 two times to find out the smaller number among three given numbers.
- here we will use the function MINIMUM2 2 times, First time we call and we will send 2 out of 3 values and function will return
us the minimum of those two values.
And then again we will send the minimum value we got from the previous
step and the remaining 3rd value and then function will return us the smaller of those two value and that will be our smallest value among the 3 given value.
- Function “MINIMUM3 (intint) "
- the function has three parameters which accepts the values when main function calls the function
- and then it uses the function MINIMUM2 () 2 times to calculate the smallest among three given values
- returns the smallest value to the calling function
- Function “MINIMUM2 (intint) "
- The function has two parameters which accepts the values when main function calls the function.
- It calculates the smaller number with the use of "Lessthan" operator.
- Returns the smaller value.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Using Python & import sys
Create a program that has a function that takes as arguments a first and last name and creates a username. The username will be the first letter of the first name in lowercase, the last 7 of the last name in lowercase, and the total number of characters in the first and last names. For example, Eastern University would be eversity17.
The program should print "Your username is x" where x is the username.
The programming language is python.
Task 13 Write a python function that will perform the basic calculation (addition, subtraction, multiplication and division) based on 3 arguments. They are: Operator (+,",Y.") • First Operand (any number) • Second Operand (any number) Your first task is to take these arguments as user input and pass the values to the function parameters. Your second task is to write a function and performs the calculation based on the given operator. Then, finally return the result in the function call and print the result.
Input: 10 20
Function Call:
function_name("+", 10, 20)
Output: 30.0
Chapter E Solutions
C++ How to Program (10th Edition)
Knowledge Booster
Similar questions
- Read MACRO Display MACRO mov ah,01h mov dl,al int 21h Mov ah,02h ENDM int 21h ENDM ALP for Finding Factorial of number using proceduresarrow_forwardDo not use global variables for this assignment Choose descriptive variable names in all programs. Currency format. There should be no space between the $ sign and the first digit. In python, Write a program that uses a custom function named as you wish and the main function. In main, prompt the user for a first name and an integer less than 10 and then execute the custom function with these two inputs as arguments. The custom function should output one line displaying the name as many times as specified by the integer, separating each repetition of the name with a space.arrow_forwardUsing Pythonarrow_forward
- Use PYTHON to create a HANGMAN game: Your hangman game should be broken into appropriate functions, contain a main function, and do the following: 1.The program should randomly select a word from the list: kangaroo,capybara, wombat, koala, wallaby, quokka, platypus, dingo, kookaburra 2. Repeatedly prompt the user to guess a letter. 3.Validate the input 4. All guessed letters should be stored in a two-dimensional list (from problem 2). If the number of times a letter has been guessed is greater than 1, then the user should benotified that they have already guessed this letter and prompted to guess a different letter. The hangman won’t update (grow) if the same incorrect letter is guessed multiple times. 5. The word should be printed where all correctly guessed letters are revealed, and all unguessed letters are replaced with underscores 6. A hangman reflecting the number of incorrect guesses should be printed 7. If all the letters in the word are guessed, then the user wins. If…arrow_forwardOne foot equals 12 inches. Write a function, using python, named feet_to_inches that accepts a number of feet as an argument and returns the number of inches in that many feet. Use the function in a programs, using python, that prompts the user to enter a number of feet then displays the number of inches in that many feet.arrow_forwardCreating a function table, python code from the following pictures:arrow_forward
- 2. Use python language for the programarrow_forwardproj1c Write a python program that ask the user to input two integers and then asks the user if they want to input + or - to perform the operation on the input numbers. You must call a function to perform the operation and return the appropriate value after the operation is performed and print out your result in the main program. Please post privately projlearrow_forward3. Create a function in python that calculates the commission for a salesman based on the table below: Between $10,000 - $20,000 Between $20,000 - $30,000 $30,000 and over | 2% of sale 3.5% of sale 5% of sale Allow the accounts clerk to enter the sales figures for the salesman. The output should read, "The sales commission is S..". (two decimal places).arrow_forward
- In Python Please If you roll a pair of dice, you can get anywhere from 2 to 12. Write a program that uses a function to check if the input is a valid number from rolling two dice.arrow_forwardplease use pythonarrow_forwardPYTHON Problem 10 print("Problem 10") Create a function named problem 10. Ask the user for a sentence that contains at least five words. For each character in the word, print the NATO Code per the chart below. Separate the letters by a hyphen. Separate words by spaces. Letter A B D E TI F H J K L M Source Code Terminal Output NATO Code Alfa Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliett Kilo Lima Mike Letter N Q R S <| כ W X N NATO Code November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey X-ray Yankee Zuluarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr