Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 8, Problem 6E
Replace the d function from
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Complete the function ConvertToWeeksAndDays to convert totalDays to weeks and days. Return weeks and days using the TimeWeekDay struct. Ex: 26 days is 3 weeks and 5 days.
Only lines 11-13 can be added onto, the rest of the program can't be changed.
Change this question to work
using a function. decide what the name of the
function of each should be, how many parameters
are required and what value needs to be returned.
You're no longer required to solve the problem - try
to re-manage your code to be a function.
Write a program that gets 2 string variables and 2 integer variables from the user, concatenates (joins them together with no space) and displays
the strings, then multiplies the two numbers on a new line and displays them with two decimal points.
n1 = int (input ("Enter a number:"))
n2 = int (input ("Enter another number:"))
s1 = input ("Enter a string")
s2 = input ("Enter another string")
print ("Concatenated string: %s, multiplied number %.2f"%(s1+s2, n1*n2))
6. Write a program which reads string and rewrite it in alphabetical order. For example, the word STRING should be written as GINRST.
7. Write a program to replace a particular word by another word in a given string. For example the “PYTHON” should be replaced by “C” in the text “It is good to program in PYTHON language”.
8. Write a program that will find the maximum number from 3 float type numbers. You have to usethe function getMax which will take 3 pointer variables and return the maximum number.
Chapter 8 Solutions
Programming in C
Ch. 8 - Type in and run the seven programs presented in...Ch. 8 - In certain applications, particularly in the...Ch. 8 - Write a function e that takes as its arguments two...Ch. 8 - If you take the value of N as computed in exercise...Ch. 8 - Write a function called c that takes as its...Ch. 8 - Replace the d function from Program 8.4 with the...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
In Exercises 3 through 24, carry out the task.
Place “CHECKING ACCOUNT”in the title bar of a form.
Introduction To Programming Using Visual Basic (11th Edition)
Figure 4-3212 shows a class list for Millennium College. Convert this user view to a set of 3NF relations using...
Modern Database Management (12th Edition)
Write an SQL statement to display the name, breed, and type for all pets that are not of type Cat, Dog, or Fish...
Database Concepts (7th Edition)
Which of the following are correct? a. False |= True. b. True |= False. c. (A B) |= (A B). d. A B |= A B. e...
Artificial Intelligence: A Modern Approach
Define a class called StringSet that will be used to store a set of STL strings. Use an array or a vector to st...
Problem Solving with C++ (10th Edition)
Why is it necessary to introduce some methods and documentation from plan-based approaches when scaling agile m...
Software Engineering (10th 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
- Write a function that takes two string parameters and their common length. It fills out the second array with the capital form of the first parameter. Test your function in the main program.arrow_forwardGiven a string which is basically a sentence without spaces between words. However, the first letter of every word is in uppercase. You need to print this sentence after the following amendments: (i) Put a single space between these words (ii) Convert the uppercase letters to lowercase. Note: The first character of the string can be both uppercase/lowercase. Write a C++ function that takes a string and then performs the mentioned amendments and returns a string.arrow_forwardCreate a function which replaces all the x's in the string in the following ways: 1. Replace all x's with "cks" UNLESS: 2. The word begins with "x", therefore replace it with "z". 3. The word is just the letter "x", therefore replace it with "ecks". Examples xPronounce("Inside the box was a xylophone") → "Inside the bocks was a zylophone" xPronounce ("The x ray is excellent") "The ecks ray is eckscellent" xPronounce ("OMG x box unboxing video x D") → "OMG ecks bocks unbocksing video ecks D"arrow_forward
- You don't need to read input or print anything. Your task is to complete the function reverseWords(string s) which takes the string S as input and returns the resultant string by reversing all the words separated by dots. Attached are the given Driver Codes examples of what the program should do.arrow_forwarduestion 42: Return whether a string consists of a single letter In the function below, return True if the input string parameter consists of a single uppercase letter; otherwise, return False. Most solutions would do this in two logical steps: first testing if the string consists of a single character and, second, testing whether that character is one of the uppercase letters (which can be done by seeing if it is alphabetically between A and Z, inclusive).arrow_forwardIn python. Include docstring. Please follow code requirements as listed below. Write a recursive function named is_subsequence that takes two string parameters and returns True if the first string is a subsequence of the second string, but returns False otherwise. We say that string A is a subsequence of string B if you can derive A by deleting zero or more letters from B without changing the order of the remaining letters. The empty string (which has zero characters) is considered a subsequence of any string (since you can derive it by deleting zero or more letters from any string). You can assume that the only characters in the strings will be lower case letters (though that shouldn't really affect your code). Note: subsequences are different than substrings, since the characters of a subsequence don't have to be consecutive. For example, 'aeiou' is a subsequence of 'faceitious', since all the characters appear in the same order, even though they're not consecutive. You may use…arrow_forward
- Complete and fix this code C program ONLY. Please finish the function printMap and updateMap to make the maze project work.Your code should move the cursor to the starting point located at the first 0 from the topand left border, and then use w, a, s, or d keys to control it to move to E. When E isreached, your code will print a message on the screen “Maze solved!!!”Please notice that part of the code is already provided, and you need to understand the code and finish it by sending screenshotsarrow_forwardDo Programming Exercise 4 from Chapter 5 using a function acronym(phrase)that returns an acronym for a phrase supplied as a string.arrow_forwardPlease fix of couple things in the code below. A couple of things. The input value is the waist size; the pant size is what the program is going to determine. The name valid_input is too generic. The name of the function should reflect what it does; also, start the name of the function with an action verb. For example, read_waist_size We can simplify the reading with the form : Read waist size WHILE waist size is not in the right range DO Show error message Read waist size again Simpler. By the way, the error message should let the user know how not to make the same mistake again. Something like, “This is not a correct size. Enter a value between 26 and 42.” is more helpful. def valid_input():while True:SizeOfPants = int(input("What pants size you are looking for: "))if 26 <= SizeOfPants <= 42:breakelse:print("This is not a correct size. Try Again!!")return SizeOfPants def return_size(SizeOfPants):if 26 <= SizeOfPants < 28:return "XXS"elif 28 <= SizeOfPants…arrow_forward
- Modify Program 7.4 so the value of triangularNumber is returned by the calculateTriangularNumber() function to the main() function. Then modify the main() function so that it calls the new version of the calculateTriangularNumber() function accordingly to display the results. (Note: Modify the program 7.4 in the similar way that program 7.5 is revised to program 7.6. All the codes are included in the lecture notes.arrow_forwardEvaluate the function y (shown in the photo.) for x = 3 to x = 5 in steps of 0.5. Write the complete code.arrow_forwardComplete the function definition given below. void printM(string s){ //display the string s with the conditions I/1. Only the letter M should be printed as it is //2. Print the character'_' at the place of all other characters I/write your code here }arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Computer Programming for Beginners | Functions, Parameters & Arguments | Ep24; Author: Programming With Avelx;https://www.youtube.com/watch?v=VXlh-qJpfw0;License: Standard YouTube License, CC-BY