Q4. Write an algorithm of a program to read from a file. The user should be able to get the option to input the file name. He is supposed to read first 100 bytes from the file. After the reading is done, the file should be closed. If the file is not available, the program should be closed immediately. You should mention "System call" beside each instruction which are supposed to use a system call function. *
Q: Compare and contrast the different approaches to characterizing computer security in Sections 1.3 an...
A: Given :- Compare and contrast the different approaches to characterizing computer security in Secti...
Q: Consider the following sequence of commands and messages: $ git clone git:cisc210/example Cloning in...
A: According to the Question below the solution:
Q: Create an ER diagram for the following requirements. Use cardinality ratio and participation constra...
A: 1. A Bank has a name, address, and a unique 5-digit code. 2. Each bank has several branches. Each br...
Q: Identify the basic business processes included within the scope of product lifecycle management.
A: -Product lifecycle management (PLM) is the process of managing the life cycle of products, services,...
Q: 1-How can the CPU recognize the device requesting an interrupt ? 2-Since different devices are likel...
A: ANSWER:- 1.) If you require more than that, a "interrupt controller" chip (also known as a PIC) t...
Q: Let a = 2. Given variables x and y as the inputs, write a MATLAB function to create: yx a Function e...
A: Find the required code in MATLAB and output:
Q: What are the benefits of Bluetooth?
A: The above question that is benifits of bluetooth is answered below
Q: Tools that are used to access the data from locations such as your desktop, a database, the cloud et...
A: ANSWER:-
Q: ned integer may be stored in whic
A: A 32-bit signed integer may be stored
Q: 2. Assume that the int array scores values. Write Java code fragments to do the following: a. Print ...
A: Input : Given the array of numbers. Output : Print array values Shift the array and square every ...
Q: Give a regular expression that denotes the language of this automaton. . Show the derivation.
A: An expression that represents a regular language is termed as a regular expression. It consists of s...
Q: Define and describe virtual memory in computing in a few sentences.
A: Virtual memory is a memory management approach that allows secondary memory to be utilized in the sa...
Q: et us consider the performance of two ARM processors executing the same program to completion. The p...
A: SUMMARY: -Hence, we discussed all the points.
Q: Describe the role of forensic investigator in instigating the computer forensics for an organization...
A: first of all, let's just talk about the word Forensic! Concerning the application of science and tec...
Q: Brief information about matlab software
A: Introduction: MATLAB combines a desktop environment optimized for iterative analysis and design with...
Q: Asap. 4. Define a method in JAVA that should take 4 numbers as the parameters and returns the averag...
A: Given: Define a method in JAVA that should take 4 numbers as the parameters and returns the average ...
Q: FQuestion 3 import numpy as np import matplotlib.pyplot as plt import cv2 # Create 3 random matrices...
A: The Below attached code is done using numpy #import numpy import numpy as np #using python ran...
Q: What is Public Blockchain and what is Private Blockchain?
A: Blockchain technology is used for digital data selling. It is decentralised type of server.
Q: Underline the infinitive and box the infinitive phrase in each sentence and identify its correspondi...
A: When a verb is used as a non finitely, with the particle or without the particle to, in a the basic ...
Q: Consider a database system for a bank that employs snapshot isolation. Describe a specific situation...
A: Database: An database is a collection of information that is stored in a database. The data is save...
Q: Mary recently read about a new hacking group that is using advanced tools to break into the database...
A: INTRODUCTION: We need tell using advanced tools to break into the database servers of organizations ...
Q: d (column H) first. What is the average Sales Price for all the properties with 2or as and more than...
A: <Use LIST worksheet> Now by calculating the "Days on Market in column L by finding the diffe...
Q: Write a segment code in any language you prefer that behaves differently if the language used (Pref...
A: Write a segment code in any language you prefer that behaves differently if the language used (Pref...
Q: A breakdown in communication between users and designers may jeopardise the success of a project.
A: Introduction: Communication failure occurs when the recipient has the wrong impression. Managers are...
Q: It is considered as a transparent box which is opposite to the definition of black box case modellin...
A: A white box is the polar opposite of a black box, as it allows for inspection of the inner component...
Q: Why are "cookies" not seen as a violation of privacy?
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other question...
Q: Polymorphism's definition and operation.
A: Polymorphism's definition:- The term "polymorphism" refers to the appearance of the same operation o...
Q: What exactly is two-factor authentication? How does it protect against stolen passwords?
A: According to the information given:-We have to define the two factor authentication and how does it ...
Q: A variable is... O A value that we can never be certain of the value of before we check it A named "...
A: Here, we are going to answer both Python question which is related to basic Python theory. What is v...
Q: Network maintenance is an important task in organizations today who entirely rely on their network i...
A: In the third раrty mаintenаnсe (TРM) industry, netwоrk mаintenаnсe is essentiаlly whаt y...
Q: Given a vector of strings, write a CPP program to concatenate all the strings present in the vector ...
A: Given: A vector of strings is given. vector<string> strs = {"VECTOR", "vector", "Program", "ve...
Q: Describe what Object-Oriented Programming is.
A: Describe what Object-Oriented Programming is.
Q: AT1 circuit provides a data rate of min 2.5Mbps and more. True or false?
A: According to the information given:- We have to find the correct option to verify the statement.
Q: What are some creative ways to use binary variables in model formulation?
A: Introduction: therefore binary variables are used to handle these options. We will now look at some ...
Q: For UNIX, can you help me out here please. List of commands to read and use: use of wild card chara...
A: Change the working directory to your login directory:- $ cd directory_name Create a subdirectory f...
Q: Please answer 2 python questions. Thank you.
A: Question 1: The answer is Option A.
Q: What is regression testing?
A: Regression testing means, testing the existing software application to ensure that the latest change...
Q: B DFA->NFA n class we showed how to convert an NFA into an an equivalent DFA. Now show how to lo the...
A: Given The answer is given below.
Q: What is the purpose of declaring a member function private?
A: According to the information given:- We have to define the purpose of declaring a member function pr...
Q: How crucial is software development? Four more characteristics, in your opinion, should be incorpora...
A: Introduction: Software development's ability to create and provide value to its users cannot be emp...
Q: Problem 1 Using bracketing methods, such as false position method, to find the root of the function ...
A: ANSWER:-
Q: I need microcontroller I/O diagram. An algorithm of main function for the ATMega48 microcontroller ...
A: Let's see the microcontroller I/O diagram in the next steps
Q: Write, compile and run a program that calculates the sine, cosine and tangent of an angle.
A: Program explanation: Import the Scanner class Define a class for implementation of the asked prob...
Q: Write a function min2 to compute the second smallest of number of an integer list. You may assume th...
A: According to the Bartleby guidelines, we can answer only one question. These are different questions...
Q: Consider a database system for an airline that employs snapshot isolation. Describe a situation in w...
A: Given: Consider a database system for an airline that employs snapshot isolation. Describe a situati...
Q: Find the output LBP Image at specified position. Imagine LBP operated on a 3x3 of input image. Demon...
A: About LBP(local binary pattern): ======================================= it is a popular technique u...
Q: What role does DCT play in picture processing?
A: Intro The question is about role does DCT play in picture processing and here is the solution in the...
Q: Using echo command, answer how the end of line (also called new line) character is displayed.
A: The given question is to discuss about the end of line using the echo command in bash. The echo comm...
Q: The word "API" refers to a programming interface for applications. What does this mean in terms of h...
A: The solution is given below for the above given question:
Q: What happens if you multiply the number ptr by four? Assuming ptr is a reference to an int, the foll...
A: Introduction: A pointer variable can be used to hold memory addresses. Pointers may be used in a var...
Step by step
Solved in 2 steps
- 1. Consider the following incomplete C++ program: #include int main() { … } a. Write a statement that includes the header files fstream, string, and iomanip in this program. b. Write statements that declare inFile to be an ifstream variable and outFile to be an ofstream variable. c. The program will read data from the file inData.txt and write output to the file outData.txt. Write statements to open both of these files, associate inFile with inData.txt, and associate outFile with outData.txt. d. Suppose that the file inData.txt contains the following data: Giselle Robinson Accounting 5600 5 30 450 9 75 1.5 The first line contains a person's first name, last name, and the department the person works in. In the second line, the first number represents the monthly gross salary, the bonus (as a percent), and the taxes (as a percent). The third line contains the distance traveled and the traveling time. The fourth line contains the number of coffee cups sold and the cost of each coffee cup. Write statements so that after the program executes, the contents of the file outData.txt are as shown below. If necessary, declare additional variables. Your statements should be general enough so that if the content of the input file changes and the program is run again (without editing and recompiling), it outputs the appropriate results. Name: Giselle Robinson, Department: Accounting Monthly Gross Salary: $5600.00, Monthly Bonus: 5.00, Taxes: 30.000 Paycheck: $4116.00 Distance Traveled 450.00 miles, Traveling Time: 9.00 hours Average Speed: 50.00 miles per hour Number of coffee Cups Sold: 75, Cost: $1.50 per cup Sales Amount = $112.50 e. Write statements that close the input and output files. f. Write a C++ program that tests the statements in parts a through e.Write a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file or the name of a directory. If the pathname refers to a file, its filepath is displayed, followed by its contents, like so: File name: file_path Lorem ipsum dolor sit amet, consectetur adipiscing elit... Otherwise, if the pathname refers to a directory, the function is applied to each name in the directory, like so: Directory name: directory_path File name: file_path1 Lorem ipsum dolor sit amet... File name: file_path2 Lorem ipsum dolor sit amet... ...Write a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file or the name of a directory. If the pathname refers to a file, its filepath is displayed, followed by its contents, like so: File name: file_path Lorem ipsum dolor sit amet, consectetur adipiscing elit... Otherwise, if the pathname refers to a directory, the function is applied to each name in the directory, like so: Directory name: directory_path File name: file_path1 Lorem ipsum dolor sit amet... File name: file_path2 Lorem ipsum dolor sit amet... ... # Put your code here import os #module used to interact with operating system def displayFiles(pathname): #recursive function that takes a pathname as argument if (os.path.isdir(pathname)): #checks if specified path (argument) is an existing directory #for item in os.listdir(pathname): for content in os.listdir(pathname): #gets the list of all files and directories in the directory and…
- C Program Task Write a programme called pgmReduce which takes 3 arguments:1. an input file (either ASCII or binary)2. an integer factor n, and3. an output fileand reduces the input file by that factor in each dimension. For example, if the invocation is:pgmReduce inputFile 5 outputFileand inputFile is a 13x17 image, then outputFile should be a 2x3 image in which only thepixels with row and column of 0 modulo 5 in the inputFile exist.C Programming Task Write a programme called pgmReduce which takes 3 arguments:1. an input file (either ASCII or binary)2. an integer factor n, and3. an output fileand reduces the input file by that factor in each dimension. For example, if the invocation is:pgmReduce inputFile 5 outputFileand inputFile is a 13x17 image, then outputFile should be a 2x3 image in which only thepixels with row and column of 0 modulo 5 in the inputFile existIn python, rite a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file or the name of a directory. If the pathname refers to a file, its filepath is displayed, followed by its contents, like so: File name: file_path Lorem ipsum dolor sit amet, consectetur adipiscing elit... Otherwise, if the pathname refers to a directory, the function is applied to each name in the directory, like so: Directory name: directory_path File name: file_path1 Lorem ipsum dolor sit amet... File name: file_path2 Lorem ipsum dolor sit amet... ... Test this function in a new program.
- This is Python Program 5: Improve the file copy program from Lab 9 so that it will make sure the user enters a file that exists. If a file doesn’t exist, the open function will raise the FileNotFoundError. You do not need to check if the destination exists since a file doesn’t need to exist to write it. Instead of copying the content of the source as exact, it only copies non-empty lines and it also prepend each line with a line number. A line is empty if the length of the line stripped of white space from both end is 0. The code segment below shows how to strip white space and getting the length of the string. If the length of the line is zero, the line is a blank line. line1 = " " line2 = " aa " print(len(line1.strip())) # 0 print(len(line2.strip())) # 2 In the sample run, “add.py” is the source file and “add-copy.py” is the destination file. Note that “add-copy.py” contains only non-blank lines from “add.py” and each line in “add-copy.py” is labelled with a line number. Sample run:…Question B. Write a C++ program that reads the marks of a group of students from a text file "grades.txt" and computes the average of all grades. The program must check the file for any opening problems, and then proceeds to do the other tasks. The input file can have 1 or more students. The text file and sample-output are shown as below: O grades - Notepad File Edit Format View Help 60.0 78.6 78.0 98.6 77.7 55.0 73.0 80.7 80.0 85.0 Windows (CF Ln 13, Col 1 100% CAUsers\Imran\Desktop\Lab111\Debug\Lab111.exe Average of 10 students is 77 Press any key to continue... Activa Coto sWrite a C program named toupper.c that reads the contents of a file, and writes to another file after changing all lowercase letters in the input file to uppercase. The name of the input file and the output file are to be passed as command line arguments. Assume there are only ASCII characters in the input file. The length of the input file is not known beforehand. So make sure your program keeps reading bytes until EOF is reached. Use the library function toupper to concert letters into uppercase. Example: The program is run from the command line as follows; C:\>toupper.exe infile.txt outfile.txt Suppose the contents of the input file infile.txt is: AbcdefG The contents of the output file outfile.txt should be: ABCDEFG
- Write a Python program to combine each line from the first file with the corresponding line in the second file and then save it in a 3rd file. Consider, both the files have same number of lines. Assume, each line has a newline(\n) at the end. ========================================================= Example:Input from file 1:HelloHiNice Input from file 2:BadWorseWorst Output in 3rd FIle:Hello BadHi WorseNice Worst ========================================================= Hint(1):Use the write() function what will be the answer of this in python programming languageSuppose a library is processing an input file containing the titles of books in order to identify duplicates. Write a program that reads all of the titles from an input file called bookTitles.inp and writes them to an output file called duplicateTitles.out. When complete, the output file should contain all titles that are duplicated in the input file. Note that the duplicate titles should be written once, even though the input file may contain same titles multiple times. If there are not duplicate titles in the input file, the output file should be empty. Create the input file using Notepad or another text editor, with one title per line. Make sure you have a number of duplicates, including some with three or more copies.Suppose a library is processing an input file containing the titles of books in order to identify duplicates. Write a program that reads all of the titles from an input file called bookTitles.inp and writes them to an output file called duplicateTitles.out. When complete, the output file should contain all titles that are duplicated in the input file. Note that the duplicate titles should be written once, even though the input file may contain same titles multiple times. If there are not duplicate titles in the input file, the output file should be empty. Create the input file using Notepad or another text editor, with one title per line. Make sure you have a number of duplicates, including some with three or more copies. (Programming Language: Java)