C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 8.5, Problem 2E
Program Plan Intro
Program Plan:
- Include library files for various operations.
- Declare three function headers.
- Declare two objects ofifstreamand ofstream.
- Declare all the required variables.
- Create a statement to open the given file “pollen.in”.
- Use for loop to read the data from the input file.
- Calculate the average of pollen count.
- int main() function is used to perform all the tasks.
- Close both files after reading and writing data to the file.
- Display the calculated results to the user.
Program Description: The main purpose of the program is to read the “pollen.in” file, create a new output file, with the user entered name, read the new value for the new pollen count from the user and to calculate the average of the newly created file.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(C Program)
(python)
Is the statement true or false?
Use the open function to open a file for input and/or output.
( C PROGRAMMING ONLY)
Do not edit anything in the main() function.
3. Entertaining the Boredby CodeChum Admin
We're now in the middle of our tour but I see these two guys getting bored. I see that their level of engagement is getting low.
Luckily, I remember that I'm good at cheering up. Oh wait, the last time I cheered someone up was a long time ago. Please help me learn how to cheer people up again.
Instructions:
In the code editor, you are provided with the main() function that asks the user for 2 double numbers which represents the engagement levels of the two bored guys and the passes the address of those 2 double numbers to the function call for the function, cheerUp().Your task is to implement the function definition of the cheerUp() function. The cheerUp() function should update the values passed by multiplying each of them by 3.Do not edit anything in the main() function.Input
1. First Engagement Level
2. Second Engagement Level
Output
Enter engagement level #1:…
Chapter 8 Solutions
C++ for Engineers and Scientists
Ch. 8.1 - Prob. 1ECh. 8.1 - (Practice) a. Write a set of two statements...Ch. 8.1 - Prob. 3ECh. 8.1 - Prob. 4ECh. 8.1 - Prob. 5ECh. 8.1 - Prob. 8ECh. 8.1 - Prob. 9ECh. 8.1 - Prob. 10ECh. 8.2 - Prob. 1ECh. 8.2 - (Practice and modify) a. Enter and run Program...
Ch. 8.2 - (Practice and modify) a. Write a C++ program that...Ch. 8.2 - (Practice) Determine the OS command or procedure...Ch. 8.2 - Prob. 5ECh. 8.2 - (Data processing) a. Write a C++ program that...Ch. 8.2 - Prob. 7ECh. 8.2 - Prob. 8ECh. 8.2 - Prob. 9ECh. 8.3 - Prob. 1ECh. 8.3 - Prob. 2ECh. 8.3 - Prob. 3ECh. 8.3 - Prob. 4ECh. 8.3 - Prob. 5ECh. 8.3 - Prob. 6ECh. 8.4 - Prob. 1ECh. 8.4 - Prob. 2ECh. 8.4 - Prob. 3ECh. 8.4 - Prob. 4ECh. 8.5 - (Practice) Write a C++ program to create the...Ch. 8.5 - Prob. 2ECh. 8.5 - Prob. 3ECh. 8.5 - Prob. 4ECh. 8.5 - Prob. 5ECh. 8 - Prob. 1PPCh. 8 - (Data processing) a. Store the following data in a...Ch. 8 - (Data processing) Write a C++ program that allows...Ch. 8 - (Data processing) Write a C++ program that permits...Ch. 8 - (Data processing) Write a C++ program that reads...Ch. 8 - (Data processing) Write a C++ program that reads...Ch. 8 - Prob. 7PPCh. 8 - (Data processing) A bank’s customer records are to...Ch. 8 - (Inventory) Create an ASCII file with the...
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
- (using C) print the following pattern on the screen usingloops. You are only allowed to use a maximum of 2 loop constructs ccccc 3333 bbb 22 aarrow_forward(C Language) Given a set of text files containing synonyms for different words, complete the main program to output the synonyms for a specific word. Each text file contains synonyms for the word specified in the file’s name, and the synonyms within the file are grouped according to the synonyms' first letters, separated by an '*'. The program reads a word and a letter from the user and opens the text file associated with the input word. The program then stores the contents of the text file into a two-dimensional array of char* predefined in the program. Finally the program searches the array and outputs all the synonyms that begin with the input letter, one synonym per line, or a message if no synonyms that begin with the input letter are found.arrow_forward(Gender Neutrality) Write the steps of a manual procedure to process a text paragraph and replace gender-specific words with gender-neutral ones. Assuming you’ve been given a list of gender-specific words and their gender-neutral replacements (e.g., replace “wife” or “husband” with “spouse,” replace “man” or “woman” with “person,” replace “daughter” or “son” with “child,” and so on), explain the procedure you’d use to read through a paragraph of text and manually perform these replacements. How might your procedure generate a strange term like “woperchild” and how might you modify your procedure to avoid this possibility? In Chapter 3, you’ll learn that a more formal computing term for “procedure” is “algorithm,” and that an algorithm specifies the steps to be performed and the order in which to perform them.arrow_forward
- (use Python)Given pre-defined variables start and stop which are both assigned to ints, use a while loop to sum the integers between start (inclusive) and stop (exclusive) and display the result. Note: You may assume that start will be less than stop.arrow_forward(C++ Programming) You are given a file consisting of students’ names in the following form: lastName, firstName middleName. (Note that some students may not have a middle name.) Write a program that converts each name to the following form: firstName middleName lastName. Your program must read each student’s entire name into a variable and must contain a function that takes as input a string, consisting of a student’s name, and returns a string consisting of the altered name. • Use the string function find to find the index of , • the function length to find the length of the string • the function substr to extract the firstName, middleName and lastName. Output the altered name into a file. This program has no user interface. Banks,John William Barret,Ron Drew,Lucy Marie Perry,Mark G Smith,John Carrarrow_forward(C Program - this is not graded)arrow_forward
- (Q4) Write a paragraph essay about the history of computer hardware and OS (Operating System). (a total of 25-30 sentences, or 1 and a half pages in length) Your essay must showcase your knowledge of hardware and software (PLEASE APPLY WHAT WE HAVE LEARN IN MS-WORD).arrow_forward(Removing break and continue ) A criticism of the break statement and the continue statement is that each isunstructured. Actually, these statements can always be replaced by structured statements, although doing so can beawkward. Describe in general how you’d remove any break statement from a loop in a program and replace it with some structured equivalent. [Hint: The break statement exits a loop from the body of the loop. The other way to exit is by failing the loop-continuation test. Consider using in the loop-continuation test a second test that indicates “early exit because of a ‘break’ condition.”] Use the technique you develop here to remove thebreak statement from the application.arrow_forward(C++ programming) This is all information for the project You are given a file containing many words. Read in all of the words from the file and insert each word into a searchable ADT. Give the user a looping menu allowing them to search for words in the word list. Searches must be be found in O(1) or constant time. Your code must time the search operations, and display the time to the user. For this assignment, you may use the provided word list or another word list with more than 150,000 words. Include this file with your submission. You must design and implement the following classes: Word: This class holds a single word as a string. Basic getters and setters are required. HashTable: This class represents the hash table for storing many words. Main: This is the driver class. The driver: Create a Hash Table Read in all of the words from a text file into the Hash Table Provide a looping menu for the user to perform searches. Time all searches and display the execution time to…arrow_forward
- (python) prov_vac_status() takes a 2-D list (similar to the database) and an integer representing the province ID. This function returns three values; (i) the total number of unvaccinated patients, (i) the total number of partially vaccinated patients, and (i) the total number of fully vaccinated patients hospitalized in this province during the entire period. Note that these numbers include both the icu and the non-icu patients. >>> res1, res2, res3 = prov_vac_status(database, 12) >>> print(f"{res1}, {res2}, {res3}") >>> 194, 14, 118 >>> print(prov_vac_status(database, 35)) >>> (402, 28, 202) >>> print(prov_vac_status(database, 81)) >>> (0, 0, 0)arrow_forward(C PROGRAMMING ONLY) 6. Before and Afterby CodeChum Admin The only constant thing in the world is change. That’s why we need to call the toupper() function to change what we already have into a better version. Instructions: Your task is to ask the user for a character input.Then, include the ctype.h built-in library and call the toupper() function. In case you do not know what this function is, this function has the following definition:Return type - intName - toupperParameter - one integer which represents the ASCII of a characterDescription - returns the ASCII of the uppercase equivalent of the character passedExtra note - even though it's function definition in the C Programming Language Documentation is int toupper(int ch), you can just pass a normal char variable instead and this will just be automatically typecasted/converted to its integer equivalent.Once you get the uppercase equivalent, print this out.Input 1. Letter to be updated Output Enter a small letter: aUppercase = Aarrow_forward(software quality engineering)Derive the test cases using boundary value analysisarrow_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
Literals in Java Programming; Author: Sudhakar Atchala;https://www.youtube.com/watch?v=PuEU4S4B7JQ;License: Standard YouTube License, CC-BY
Type of literals in Python | Python Tutorial -6; Author: Lovejot Bhardwaj;https://www.youtube.com/watch?v=bwer3E9hj8Q;License: Standard Youtube License