COMPUTER SYSTEMS&MOD MSGT/ET SA AC PKG
3rd Edition
ISBN: 9780134671123
Author: Bryant
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 7, Problem 7.9HW
Consider the following program, which consists of two object modules:
When this program is compiled and executed on an x86-64 Linux system, it prints the string 0×48\n and terminates normally, even though function p2 never initializes variable main. Can you explain this?
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
The task is to implement part of a linter program using python. Specifically, you must be able to
scan for grouping symbols ( "()", "[]", "{}") and ensure that there are no hanging open symbols or
stray closing symbols in the source file.
There will be files you will need to scan so you need the open() in your code. Also, you can use the
read() or readlines() to know which lines has no opening or stray closing symbols.
Example: You scan this code from a file, and you notice that there is a stray closing symbol ")".
1 int main(void) {
.
123
2
3
4
printf("Hello world"));
return 0;
}
The implementation must involve recursion in terms of scanning for the scope. If a different closing
symbol is encountered or the end of file is reached, the error message "Line :
missing closing symbol for "" should be displayed. For stray closing tags, the
message "Line : stray closing symbol for "".
Do not use "stack" in your code.
Write the C or C++ program system2 that reads, when being executed, OS commands via the "command line parameter" C/C++ feature, and then executes them. The
command line parameters must be legal Unix/Linux commands. Print the number of commands entered. To prepare, read about argc, argv, and envp. Focus is only argc and
argv. A sample execution by fictitious user "mike" is:
herb$ ./a.out pwd ls whoami
argc
4
pwd
argv[1]
Executing command
/Users/mikey
'pwd'
= ls
argv[2]
Executing command 'ls'
Applications
Contacts
Music
Pictures
familie
herb
Downloads
testl
Favorites
Library
Movies
testl.c
pix_low_2020 test2
test2.c
Desktop
Public
Documents
a.out
test.c
argv[3] = whoami
Executing command
mikey
'whoami'
Give an example of a C++ code snippet that performs some operation on an array (e.g. sort, search, fill, modify, etc). You should have at least six lines of executable C++ code and your code should be different than anyone
else's.
Then state the runtime of your code snippet, but don't state what the algorithm is.
Chapter 7 Solutions
COMPUTER SYSTEMS&MOD MSGT/ET SA AC PKG
Ch. 7.5 - Prob. 7.1PPCh. 7.6 - Practice Problem 7.2 (solution page 718) In this...Ch. 7.6 - Practice Problem 7.3 (solution page 718) Let a and...Ch. 7.7 - Prob. 7.4PPCh. 7.7 - Prob. 7.5PPCh. 7 - This problem concerns the m. o module from Figure...Ch. 7 - Without changing any variable names, modify bar5.c...Ch. 7 - Prob. 7.8HWCh. 7 - Consider the following program, which consists of...Ch. 7 - Let a and b denote object modules or static...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Phone Book Program Design a program that you can use to keep all of your friends names and phone numbers in a f...
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Consider the adage Never ask a question for which you do not want the answer. a. Is following that adage ethica...
Using MIS (10th Edition)
Solve the differential equation dydx=xy1x+y+3 by finding h and k so that the substitutions x=u+h, y=v+k transfo...
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
List the functions of a database application.
Database Concepts (8th Edition)
Write a SELECT statement that will return the TradingSymbol column only from the rows where SellingPrice is gre...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
What, if anything, prints when each of the following statements is performed? If nothing prints, then answer No...
C How to Program (8th 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 script that opens a file containing a list of passwords and checks to see if the passwords are strong. 1. Save a list of five passwords in a text file. 2. Write a Python script that opens the text file and reads the passwords. 3. For each password, use regular expressions to check the password strength (I recommend creating a module to do this). For a password to be considered strong, it must satisfy the following requirements: + minimum length 8 characters + must contain one or more alphabetical characters [a-z] + must contain one or more Uppercase characters [A-Z] + must contain one or more numeric characters [0-9] + must contain one or more special characters [_$!]arrow_forwardI am getting an Null pointer exception but after that i have an important code that i want to run in any condition. Please handle this in Java programming language.arrow_forwardIn this assignment, you will create a Java program to search recursively for files in a directory.• The program must take two command line parameters. First parameter is the folder to search for. Thesecond parameter is the filename to look for, which may only be a partial name.• If incorrect number of parameters are given, your program should print an error message and show thecorrect format.• Your program must search recursively in the given directory for the files whose name contains the givenfilename. Once a match is found, your program should print the full path of the file, followed by a newline.• You can implement everything in the main class. You need define a recursive method such as:public static search(File sourceFolder, String filename)For each subfolder in sourceFolder, you recursively call the method to search.• A sample run of the program may look like this://The following command line example searches any file with “Assignment” in its name%java FuAssign7.FuAssignment7…arrow_forward
- The following question is related to Threading in C programming Task-3: Write a program in c that has a function that takes the name of the user and adds all the ASCII value of the characters and returns it. Now create 3 threads that run the function using 3 different user names. Now print “Youreka” if all the returned values are equal, print “Miracle” if the 2 returned values are equal, and print “Hasta la vista” if the values don’t match using another thread.arrow_forwardWrite code in C language. Create an integer array as input in C programming language. Create two threads. The first thread sums the even elements of the array, and the second thread sums the odd elements of the array. You can declare only one function outside the main functionarrow_forwardWrite a Java program that reads from a URL and searches for a given word in the URL and creates a statistic file as an output. The statistic file needs to include some information from the URL. URL address Number of words in the URL page Number of repetitions for a given word displays the number of times the word appears. You need to have two functions, one for reading from the URL and the other function for searching the word.arrow_forward
- Hello, I have an assignment in the python program. Professor gives me a text like this: January.txt 217283921200.5619.18,29.15,78.75,212.10100,20,410.29 The first line is an account number, the second line is the beginning balance, the third line is withdrawn and the last line is deposits. How can I separate every single line to read them. Can I use the loop function? Below is the assignment direction. Thank you very much ___________________________________________________________ Complete the following program: a) Read in and store the data from the file called “January.txt”. This file includes the customer’s account number, beginning balance, withdrawals, and deposits. (In that order) Note: Make sure you look at the file before you begin the project! b) Prompt the user for his/her name and age. c) Convert the customer’s name to a username that consists of the first letter of the first name, the first 5 digits of last name, and the customer’s age.(All letters should be lowercase)…arrow_forwardWrite 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 more 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. If the files cannot be opened for writing, a proper error will be generated. The program then reads the source file line by line. It will copy every line that has a digit in it to destination 2 and lines that have no digit in them to destination 1. Feel free to use ctype’s isdigit() function to identify digit characters. Example: If source file is:Hi My name is VeriaHello My name is John. How can I help you?I have a problem with my giga bit internet. The speed should be around 1000 but it’s just 200 Sure! I can help with that. Can I have your number in case we get disconnected? Sure! My number’s 647-123-1234 First file (destination 1) should be Hi My name is Veria Hello…arrow_forwardNeed Help with C++ coding, and please explain the first step in detail. Write a program in C++ that performs three functions using threads on the attached text file called long_text.txt 1. Write your code in a such way that you can show in terms of time that using threads does not keep you blocked i.e., the main thread gets free once all threads start. a.This means that your program will run the three functions without threading and then with threading. 2. Functions to implement are: a. word_count() → will count the number of words in the text file b. sentence_count() → will count the number of sentences in the text file c. find_frequent_word() → finds the most frequently occurring word and number of times it occurred in the textarrow_forward
- Problem Y: Implement the reader writer problem using pthreads and semaphores. You should allow multiple readers to read at the same time and only one single writer to write to the data set. You are required to use the following: 1. A semaphore rw_muter initialized to 1. 2. A semaphore muter initialized to 1. 3. An integer reader_count initialized to 0.arrow_forwardUse the Bash shell for the completion of this project. Develop a shell scripting application that allows the user to perform some advanced mathematical operations. Your application should allow the user to perform these tasks: Task 2: Find the term of any linear sequence given by the rule Term = a * n + b, where a and b are integers specified by the user and n is a positive integer and print them in order (for example if the user inputs a=3, b=-4, the first few terms that should be printed are -1, 2, 5, 8, 11…). The user also will specify how many terms the program should print. In addition, the program should print the sum of terms found and a count of how many odd terms were found.arrow_forwardJava only Design, implement and test a Java class that processes a series of triangles. For this assignment, triangle data will be read from an input file and the program’s output will be written to another file. The output file will also include a summary of the data processed. You must use at least one dialog box in this program. The data for each triangle will be on a separate line of the input file, with the input data echoed and the results referred to by the line number (see example). On initialization, the program will prompt the user for both an input and an output file. If a non-existent input file is specified, the appropriate exception must be handled, resulting in an error message. For the exception case, re-prompt the user for the correct input file. Once the I/O file is specified, the program will read in and process all the entries in the file. The output of the program will be written to the specified output file and echoed to the console. The program will…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
Instruction Format (With reference to address); Author: ChiragBhalodia;https://www.youtube.com/watch?v=lNdy8HREvgo;License: Standard YouTube License, CC-BY