Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 9.8, Problem 9.5PP
Practice Problem 9.5 (solution page 882)
Write a C
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
[no. 19] When would you use a while loop?
a. when you want some code to continue running as long as some condition is true
b. when you want to run code in one file while code in another file is also running
c. when you want to minimize the use of strings in your code
d. when you need to run two or more chunks of code at once within the same file
Use files( handling exception)
Problem 2 (Cipher module)• Create a Python file named cipher_module.py with functions to encode and decodestring inputs using the basic Caesar cipher (see here for more informationhttps://en.wikipedia.org/wiki/Caesar_cipher). This cipher is a basic encryptiontechnique that supports encoding and decoding operations on strings.• The encoding operation replaces each character in a string with another charactersome fixed number (shift) of positions down the ASCII table. The string can beencoded using any characters on the ASCII table and no need to use the circular list(where ‘Z’ is followed by ‘A’) image shown below. Your module must have a functionnamed encode() that takes a string and an integer shift (can be positive or negative)as parameters and returns the encoded string using the shift value. This module must
Page 3 of 4also have a second function name decode() that takes an encoded string and aninteger shift as parameters and returns the decoded string. The decoding…
Chapter 9 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 9.2 - Prob. 9.1PPCh. 9.3 - Prob. 9.2PPCh. 9.6 - Prob. 9.3PPCh. 9.6 - Prob. 9.4PPCh. 9.8 - Practice Problem 9.5 (solution page 882) Write a C...Ch. 9.9 - Prob. 9.6PPCh. 9.9 - Prob. 9.7PPCh. 9.9 - Prob. 9.8PPCh. 9.9 - Prob. 9.9PPCh. 9.9 - Prob. 9.10PP
Ch. 9 - Prob. 9.11HWCh. 9 - Repeat Problem 9.11 for the following address....Ch. 9 - Repeat Problem 9.11 for the following address....Ch. 9 - Given an input file hello.txt that consists of the...Ch. 9 - Determine the block sizes and header values that...Ch. 9 - Prob. 9.16HWCh. 9 - Prob. 9.17HWCh. 9 - Prob. 9.18HWCh. 9 - Prob. 9.19HWCh. 9 - Write your own version of malloc and free, and...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
If = 60 and F = 450 N, determine the magnitude of the resultant force and its direction, measured counterclock...
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Use the following tables for your answers to questions 3.7 through 3.51 : PET_OWNER (OwnerID, OwnerLasst Name, ...
Database Concepts (8th Edition)
T F vectors can report the number of elements they contain.
Starting Out with C++ from Control Structures to Objects (9th Edition)
Practice Program 5.4 asked you to define Trivia class that contained strings representing a trivia question and...
Java: An Introduction to Problem Solving and Programming (8th Edition)
Present Value Suppose you want to deposit a certain amount of money into a savings account, and then leave it a...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Areas of Rectangles The area of a rectangle is the rectangles length times its width. Design a program that ask...
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
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
- (c) Write a Haskell program that: • Reads two files, called "input1.txt" and "input2.txt". • Interleaves the lines of the two files. • Writes the result to a file called "output12.txt" . You may make use of any functions in the Reference (pp5-7).arrow_forwardC++arrow_forward(1) Create a cpp file Array Operations under Source files folder. Write a program in C++ to declare an array called mark. This array will store marks of an assessment like practical, assignment or test for 16 students. Therefore, the size of the array should be 16. a. Number of available marks are 10 for ten students, however there are 16 students, therefore, the remaining marks will be read into the program while the program is running. For now, initialize the array with given marks. 7.3 8.6 10.65 16.4 13.5 6.35 17.3 4.4, 8.5, 12.7 b. With reference to unavailability of remaining 6 marks in part a, write codes to read these remaining six marks and add them at the end as you read. c. Write codes to count the numbers above the average. d. Write codes to determine the highest mark a student scored. e. Display all the important data and results with descriptive relevant labels. [At the end of this activity, comment out your program, so that you next program of activity 2 below will…arrow_forward
- Question 4 (PROGRAMMING) A classification algorithm is a kind of machine learning algorithm which is used to assign a label to an object, based on the knowledge of similar objects. Write a C program able to implement the classification algorithm 1-NN. The program receives as input two files and , whose names are passed as arguments from the command line: The file contains a set of N objects (one for each line), each one with the corresponding label. This file is used to train the classification algorithm, which learns how to recognize the known objects. Each line of the file contains the name of the object represented as a string at most 5 characters, a set of M real numbers T1 T2 T3 .. TM, followed by an integer L. The space character is used to separate the elements. The M real numbers are the features that represents an object. The integer L is the object label. The file contains a set of objects to be classified. The format is similar to the file, but the number of rows is NOT…arrow_forward(3) Create the final cpp file under Source files and name it 2D Imaging. Write a C++ program to replace the star or asterisk (*) character with any other character of your choice. You may choose to use that ascii code of one of the characters. You must write a 2-Dimenional loop to programmably replace the character. To do this you must list on paper the row and column pairs of the 2D array that stores the given character. You may see a pattern of number series. Use this pattern to write the loops. The image pattern draws a V shape on the 12rows-11column 2D Grid or board. { {' }; '}, '}, '}, '},arrow_forwardI'm working on a program and need help.I need to write a C function with a char array (char *) parameter for a filename, and returns a char array (char *) containing all the characters in the file. The returned array should end with a '/0' to form a valid string.The array returned should be dynamically allocated, no larger than twice the character length of the file. It needs to be done in one I/O pass and dynamically allocate more memory for larger input.The function cannot use any functions that would determine the size of the file. No fstat() or fseek() or anything like that. It also cannot allocate or copy memory on each loop iteration. It cannot use realloc(), only malloc() and free(). It should use linear time and space and take up no more memory than 2 times the characters in it.arrow_forward
- Pls help ASAP, program C (Loops)arrow_forwarduse code to develop a C program that gets a source file name from a user. If the file does not exist, it will generate a proper error and exits. If the file exists, it also gets the name of two files from the user, say destination1 and destination2. These files don't need to exist as they are files that need to be written to. The program then reads the source file line by line. If the line starts with an uppercase and ends with a lower case, it copies that line to dest1 (first destination file) If the line starts with a lowercase and ends with a dot ('.'), it copies that line to dest2 (second destination file) If neither of the above hold, the program discards that line (doesn't copy it anywhere) The program then displays a report mentioning how many lines were copied into each destination file. Don't forget to close all the files. Example: Assume that the source file is (<NL> = new line, <EOF> end of file): Souce: "myfile.txt" This is my first line<NL>…arrow_forwardExperiment 17 Directories I. Objective After performing this activity, you should be able to 1. Perform operations on directories in assembly language. II. Introduction This experiment covers a number of extended DOS services for disk operations introduced by DOS 2.0 and 3.0. Many of these services are much simpler than the original DOS services are generally recommended. These operations involve the use of an ASCIIZ string to initially identify a drive, path and filename; a file handle; and special error return codes. Int21H Service 39H: Creating a directory Function 39H creates a subdirectory, just like the DOS command MD For example, diname, dh 'C:\TASM',0 mov ah, 39h lea dx dirname int 21h A successful operation creates the subdirectory TASM in drive C. An error sets the carry flag and returns code 03 (path not found or invalid path) or 05 (access denied or directory already exists) in register AX. INTIH Service 3AH: Removing a directory Function 3AH deletes a subdirectory. just…arrow_forward
- (python) Write a function startWith(File, Let) that takes a file name and a letter. Each line in the file contains 1 word. The function should store a new file with all the words that start with letter Let. Example: startWith (‘Test1-3.txt’, ‘A’) Source File: (Test1-3.txt) Output File: (Test1-3New.txt) Hi Airport Airport Apple Hello Apple Mangoarrow_forwarduse MIPS instruction only please test the file with any text file yoi have. wirte comments and make it simple please Thanksarrow_forwardHi, in C programming , I try to implement 2 functions to check those followings instructions in a file text : The first function :Find the number of words with duplicates on a file The second function: • Find the most frequent letter (without considering duplicates) Finally write those results on another file. Thanksarrow_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
Instruction Format (With reference to address); Author: ChiragBhalodia;https://www.youtube.com/watch?v=lNdy8HREvgo;License: Standard YouTube License, CC-BY