Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 6, Problem 2AW

The following pseudocode statement calls a function named half, which returns a value that is half that of the argument. (Assume both the result and number variables are Real.) Write pseudocode for the function.

Set result = half(number)

Blurred answer
Students have asked these similar questions
The following statement calls a function called half(), which returns a value that is half of (float) the argument:        half(5)   >>>2.5   Write the code for the half() function.  The program should have at least two functions (main and one more).  Style (headers, names of variables/parameters/arguments, indentation) needs to be correct.
slope(x1, y1, x2, y2) that calculates the slope of the line that connects the two points. The function returns the slope to the main program. If the slope is undefined, your function should return the word “undefined”. Test the function in the main part of the program with the following values and print the results:
Future Investment Value = investment amount * (1 + monthly interest)^(number of years * 12) Using this formula, write a function in Python called futureValue that prompts the user to enter an investment amount, an annual percentage interest rate, and the amount of years. The function should accept the input as arguments. The interest rate should have a default value of 7%. You can add default values of your choice for the amount of years. This function should print out a table that displays the future values. Demonstrate this function in another function called main. Format your output by two decimal places. Output Example: Enter the amount you want to invest: 1000 [Enter] Enter the interest rate for your investment: [Enter] Enter the number of years you want to invest this money: 30 [Enter] Years Future Value 1 1093.81 2 1196.41 ........ 30 14730.58

Chapter 6 Solutions

Starting Out with Programming Logic and Design (4th Edition)

Ch. 6 - This part of a function definition specifies the...Ch. 6 - This part of a function definition is comprised of...Ch. 6 - In pseudocode, this statement causes a function to...Ch. 6 - This is a design tool that describes the input,...Ch. 6 - This type of function returns either True or...Ch. 6 - This is an example of a data type conversion...Ch. 6 - Prob. 9MCCh. 6 - Prob. 10MCCh. 6 - The code for a library function must appear in a...Ch. 6 - Prob. 2TFCh. 6 - In many languages it is an error to assign a real...Ch. 6 - In some languages you must use a library function...Ch. 6 - Prob. 5TFCh. 6 - What is the difference between a module and a...Ch. 6 - Prob. 2SACh. 6 - Prob. 3SACh. 6 - Prob. 4SACh. 6 - Prob. 5SACh. 6 - Prob. 6SACh. 6 - As shown in this chapter, write a pseudocode...Ch. 6 - The following pseudocode statement calls a...Ch. 6 - A pseudocode program contains the following...Ch. 6 - Design a pseudocode function named timesTen that...Ch. 6 - Design a pseudocode function named getFirstName...Ch. 6 - Assume that a program has two String variables...Ch. 6 - The programmer intends for this pseudocode to...Ch. 6 - Can you find the reason that the following...Ch. 6 - Can you find the reason that the following...Ch. 6 - Feet to Inches One foot equals 12 inches. Design a...Ch. 6 - Math Quiz Design a program that gives simple math...Ch. 6 - Maximum of Two Values Design a function named max...Ch. 6 - Falling Distance When an object is falling because...Ch. 6 - Kinetic Energy In physics, an object that is in...Ch. 6 - Test Average and Grade Write a program that asks...Ch. 6 - Odd/Even Counter In this chapter you saw an...Ch. 6 - Prime Numbers A prime number is a number that is...Ch. 6 - Prime Number List This exercise assumes you have...Ch. 6 - Rock, Paper, Scissors Game Design a program that...Ch. 6 - Prob. 12PE
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
functions in c programming | categories of function |; Author: Education 4U;https://www.youtube.com/watch?v=puIK6kHcuqA;License: Standard YouTube License, CC-BY