Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 13, Problem 2E
Write a function called m that takes as its argument a value of type e m (as defined in this chapter ) and returns a pointer to a character string containing the name of the month. In this way, you can display the value of an e variable with a statement such as:
P
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A function can return another function.
True
False
NOTE: PYTHON CODE
Create a python program that will overload a function named substring. The function will ask the user to enter the index range of the substring inclusive. Using the function defined the program will display the whole string value, the substring given the start index, and the substring given the start and last index.
About beginner python programming:
-
Make a function in Python called SIGA, which receives a tuple containing 4 pieces of information: the nameof the student and his three respective grades. Your function should return a tuple, whose first element is the student's name,the second element is the grades average, and the third element is the student's situation, which must be representedby a string. If the average of the three grades of the student is greater than or equal to 7 (inclusive), the function should bereturn: (<name>, <average>,’approved’, ’Congratulations!́). If the student's average grades is less than 7 but greater than or equal to 5, your function should return: (<name>, <average>,’approved’). If the average is smallerthan 5, the function should return (<name>, <media>,’failed’). This function should return the averagewith one decimal place only.
Chapter 13 Solutions
Programming in C
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
How many lines of output does the following function print? Give your answer as a function of n. Assume n 1.
Computer Systems: A Programmer's Perspective (3rd Edition)
Write a loop that asks the user Do you want to repeat the program or quit? (R/Q)". The loop should repeat until...
Starting Out with Python (3rd Edition)
Design an algorithm that does the following: opens the number_1ist.dat file that was created by the algorithm c...
Starting Out with Programming Logic and Design (4th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Fat Gram Calculator Write a program that asks the user to enter the number of calories and fat grams in a food ...
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Write an SQL statement to display the last name, first name, and email of any owners of cats. Use a subquery.
Database Concepts (7th Edition)
Knowledge Booster
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
- Programming Assignment Create a program application using C#, C++, or your preferred software for a small Employee Payroll system using one dimensional arrays. Include the following for at least 5 employees for a period of 3 months (assume the employees are paid monthly) a. hourly wages b. monthly earnings c. annual earnings d. monthly deductions (look the basic deductions) e. annual deductions f. net pay g. gross payarrow_forwardQuestion 8: Write a function that takes a number and returns the largest digit value in the number. For example, given 34567 the function returns 7, and given 28634 it returns 8. def max_digit (n) : # Remove this line before you answer this question. If you will NOT answer # this question, then do NOT remove this line. returnarrow_forwardInstructions Write a function create_password() expects two parameters: pet_name (a string) and fav_number (an integer). The function returns a new password generated using the following pattern: fav_number followed by the pet_name followed by the star * and fav_number again (see the example below). Create a program that gets a pet name and a favorite number as input from the user, calls the above function, and then prints the output as shown below. Example Input: Angel 3 Output: Your new password is "3Angel*3". Note that the double quotes are part of the output. The assert in the provided template is checking that this function call is returning the correct value (i.e., a correctly-formed string). assert create_password("Angel", 3) == "3Angel*3" Hints Remember that you cannot directly concatenate an integer and a string - you need to convert an integer into a string using either str() or by using f-strings. Troubleshooting If you are getting AssertionError make sure that your…arrow_forward
- mplement a function gct according to these guidelines: The function accepts a single positive integer which represents a number of tablespoons of a liquid. You may assume that this number is always between 0 and 25599 (inclusive of both). The function returns a formatted str containing an equivalent number of gallons, cups andtablespoons. The answer should use as many gallons, then cups as possible. For example:gct(312) would return '01g,03c,08t' as 312 tablespoons is equivalent to 1 gallon, 3 cups, and 8 tablespoons. Each of the output quantities (gallons, cups, tablespoons) should occupy two digits. If the values have less than two digits, they should be padded with leading zeroes. I.e., 2 cups is represented by '02c' .arrow_forwardPython task You must write a function control (p_nr) that calculates and returns the control digit in a 10-digit social security number if you send in the first 9 digits in the form of a string. The rules for calculating the check digit in a social security number are as follows:The numbers are multiplied alternately by 2 and 1 and then the products are summed. For a two-digit product, the sum of its numbers is calculated. The sum is then subtracted from the nearest higher tens to obtain the check digit.To calculate the check digit for the social security number with the first 9 digits 811218987, perform the following setup: 8 1 1 2 1 8 9 8 7 2 1 2 1 2 1 2 1 2 16 1 2 2 2 8 18 8 141 + 6 + 1 + 2 + 2 + 2 + 8 + 1 + 8 + 8 + 1 + 4 = 44The check digit is 50-44 = 6 # test personal_number = input () control_digit = control(personal_number) print(control_digit)arrow_forwardWhen a function accepts multiple arguments, does it matter what order the arguments are passed in?arrow_forward
- Q2: Write a function that, when you call it, displays a message telling how many times it has been called: “I have been called 3 times", for instance. Write a main() program that calls this function at least 10 times. HInt: use a global variable to store the countarrow_forwardC++ beginnerarrow_forwardWhen a function accepts several arguments, how important is it what order those arguments are sent in?arrow_forward
- Function #2: largest Parameters: num1 - a floating point number being compared against num2 and num3 num2 - a floating point number being compared against num1 and num3 num3 - a floating point number being compared against num1 and num2 Description: Write a function that takes in three numbers as parameters and prints out the largest of the three. If two or all of the numbers are equal, or even all three, then just print the value once. Test Cases: >>>largest(433.1, 2340.32, 12323.7) 12323.7 >>>largest(12.0, 32.1, 32.1) 32.1 >>>largest(23.44, 23.44, 23.44) 23.44arrow_forwardWrite a function, named timesTen, that accepts an integer argument. When the function is called, it should display the product of its argument multiplied times 10.arrow_forwardINT 33h is a function that collects information about mouse button pushes; what function does this?arrow_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 PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
What Are Data Types?; Author: Jabrils;https://www.youtube.com/watch?v=A37-3lflh8I;License: Standard YouTube License, CC-BY
Data Types; Author: CS50;https://www.youtube.com/watch?v=Fc9htmvVZ9U;License: Standard Youtube License