C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 15, Problem 15.9E
Write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
1. Write a program that inputs a string and output a series of ICAO words that would be used to spell it out. For example:Enter string: Program TestPhonetic version is: Papa Romeo Oscar Golf Romeo Alpha Mike Tango Echo Sierra Tango.
Note that there is a space in the string being translated and letters can be entered either upper or lower case. Any characters other than alphabet or the space should be ignored.2. You should create a function called BuildCodeArray to build an array of strings of the ICAO words.3. You should create a second function called TranslateString that takes a string and translates it into the ICAO spelling.4. After printing the ICAO words the application should ask the user if they want to translate another string and continue looping until the user indicates they do not want to translate another string.Be sure to use proper formatting and appropriate comments in your code. Provide appropriate prompts to the user. The output should be clearly labeled and neatly.…
In c++ Write a program to swap the contents of two variables. Use template variables as function arguments.
good stat ofl them ii
days.
You need to upload your solutions in a single python file (assl.py) to the link on MS Teams.
Part 1
Add this comment: # Ass 1: Part 1
Write a program that declares a function called draw Star which receives an
integer value as a parameter, and draws a number of stars equal to the received
integer.
Samplel:
Please enter the number of stars: 5
The shape is:
****
Sample2:
Please enter the number of stars: 3
The shape 15 ***
Part 2
Add this comment: Ass 1: Part 2
Write a program that
summation of even ni
"nd M then prints the
3.9 nclud d if were even
of 3
Chapter 15 Solutions
C How to Program (8th Edition)
Ch. 15 - Write a C++ program that prompts the user for the...Ch. 15 - Write a complete C++ program with the two...Ch. 15 - Prob. 15.7ECh. 15 - Write a program that uses a function template...Ch. 15 - Write a program that uses a function template...Ch. 15 - Determine whether the following program segments...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Write a program to print the corresponding Celsius to Fahrenheit table.
C Programming Language
Briefly describe the purpose of a constructor.
Starting Out with C++ from Control Structures to Objects (8th Edition)
What is denormalization?
Database Concepts (7th Edition)
Using examples, illustrate the different types of adaptor needed to support sequential composition, hierarchica...
Software Engineering (10th Edition)
(Asterisked problems are associated with optional sections.) 20. Suppose you were given two stacks. If you were...
Computer Science: An Overview (12th Edition)
Write a statement that initializes a List with 4 values of the double data type.
Starting out with Visual C# (4th 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
- Python question, please us a docstring and have comments throughout code Write a function getInteger() that takes two integers num1 and num2 as parameters. If num1 > num2, then the function prints an error message and returns 0. If num1 is equal to num2, the function returns the common value. For cases where num1 < num2, the function prompts the user to enter an integer greater than or equal to num1 and less than or equal to num2 and returns the first valid integer that the user enters. If the user enters something that is not an integer value, the programs should display an error message and re-prompt the user to enter a valid integer Below are some sample executions of the function. Use the while and if-elif statements and a try/except in the solution. Don’t forget to include the docstring and comments. Copy and paste or screen shot the code and the thirteen test cases shown below in your submission. . >>> getInteger(5,4) 5 and 4 are not valid parameters 0…arrow_forwardWrite a function named product that takes two int parameters and returns the product of those two integers. Here is an example: int n = product(7, 5); // n is 35 We are providing a test framework that, if you wish, you may use with a compiler to test your function. What you will submit as your answer to this problem is only the product function. Do not submit things like the #include lines or a main routine. If we take the code you write in the space below and insert it into the program, the resulting program must build without compilation errors (mere warnings are allowed). You do not need to write comments in the code; we will not look at any comments. Here is the test framework that you may copy and paste into a C++ source file. For your own testing purposes, you might add additional tests in the main routine, although you won't be turning them in, of course. #include <iostream> #include <cassert> using namespace std; // SUBMIT AS YOUR ANSWER ONLY THE CODE BETWEEN THIS…arrow_forwardAdd a function to get the CPI values from the user and validate that they are greater than 0. 1. Declare and implement a void function called getCPIValues that takes two float reference parameters for the old_cpi and new_cpi. 2. Move the code that reads in the old_cpi and new_cpi into this function. 3. Add a do-while loop that validates the input, making sure that the old_cpi and new_cpi are valid values. + if there is an input error, print "Error: CPI values must be greater than 0." and try to get data again. 4. Replace the code that was moved with a call to this new function. - Add an array to accumulate the computed inflation rates 1. Declare a constant called MAX_RATES and set it to 20. 2. Declare an array of double values having size MAX_RATES that will be used to accumulate the computed inflation rates. 3. Add code to main that inserts the computed inflation rate into the next position in the array. 4. Be careful to make sure the program does not overflow the array. - Add a…arrow_forward
- please code in pythonarrow_forward6. 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.arrow_forwardA number, a, is a power of b if it is divisible by b and a/b is a power of b. Write a function called is_power that takes parameters a and b and returns True if a is a power of b. Note: you will have to think about the base case. After writing your is_power function, include the following test cases in your script to exercise the function and print the results: print("is_power(10, 2) returns: ", is_power(10, 2)) print("is_power(27, 3) returns: ", is_power(27, 3)) print("is_power(1, 1) returns: ", is_power(1, 1)) print("is_power(10, 1) returns: ", is_power(10, 1)) print("is_power(3, 3) returns: ", is_power(3, 3))arrow_forward
- python: Create a function called myemail that takes two arguments: a first name and a last name, and returns a Blue Ridge email address in lower case. The email is made by taking the first letter of the first name and the first 5 letters of the last name and adding 01 and @my.blueridgectc.edu to the end. For example, the function call: myemail('Amelia','Earhart') should return aearha01@my.blueridgectc.eduarrow_forwardPrompt: In python language, write a function that give that find the total number of alphanumeric characters in the original input text, the total number of unique numeric characters in the original input text, remove all non alphabetic characters, convert all text to lowercase, the total number of words after preprocessing, the total number of unique words after preprocessing. code: sampleText = "The university was built in 1854. The university`s enrollment is approximately 19000 undergraduate students and 8600 graduate students.[5]" # Your function should return 4 variables: alphaNumCount, uniqueNumCount, wordCount, uniqueWordCount def textPreprocessing(textString): alphaNumCount, uniqueNumCount, wordCount, uniqueWordCount = (0, 0, 0, 0) #YOUR CODE HERE: def test(sampleText): alphaNumCount, uniqueNumCount, wordCount, uniqueWordCount = textPreprocessing(sampleText) print("Total number of alphanumeric characters in the original input text: ", alphaNumCount) print("Total…arrow_forwardWrite a function that displays at the left margin of the screen a solid square out of whatever character is contained in character parameter fillCharacter. Thus, if side is 5 and fillCharacter is #, then this function should print the following: (example of function: void square( int side, char fillCharacter )) Sample output Enter a character and the side length: # 5 ##### ##### ##### ##### #####arrow_forward
- Write a Python function that will perform unit conversions. Your function should take two arguments. The first argument is a float that is the temperature in Celsius and the second argument is a string that take on one of four values; "Fahrenheit", "Celsius", "Rankine", "Kelvin". Your function should be named temp_convert and return a float of the converted temperature. An example of using the function is shown below: new_temp temp_convert(e,"Fahrenheit") This will result in a value of 32.0 being assigned to the variable new_temp. Save your file as a pdf titled [Last Name)_[First Name) [Section]_Hmk4-5.pdf. An example file uploaded to eCampus would be Doe John_501 Hmk4-5.pdf.arrow_forwardThere is only 1 ques with 2 part. Please answer the questions ( Answer in python ) Part I: Cities. Write a function called describe_city which accepts the name of a city and its country. The function should print a simple sentence as shown in the output example. Give the parameter for the country a default value. Make 5 calls to the function using the following arguments: Reykjavik, Iceland Pittsburg Ontario, Canada Cairo, Egypt Miami, USA Output Example : ( FOLLOW THE OUTPUT SAME AS GIVEN BELOW ) Reykjavik is in Iceland Pittsburg is in USA Ontario is in Canada Cairo is in Egypt Miami is in USA Part II: Blastoff!!! Write a function called count_down which has 1 integer parameter. The function should countdown from that parameter value to 1. Each step in the countdown should be printed on the same line followed by ‘Blastoff!!!’ also on the same line. All of this should happen in the function. Make 3 calls to the function with the following arguments: 3 5 10 Output…arrow_forwardCreate a program that: 1. Prompts the user to enter a string. 2. Use ANY method you'd like to remove all the vowels from the string (string function substring, accessing the string characters as arrays, etc.), creating a new string. 3. Output the new string with all the vowels removed. 4. The program MUST contain two functions-- (1) to remove all the vowels from the string, i.e., create a new string from the old string; (2) to determine if a character is a vowel. 5. Use an enumerated type to evaluate each character to determine if it is a vowel. Hint: Write the program WITHOUT the enumerated type first to get it working.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
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