3. an output file and reduces the input file by that factor in each dimension. For example, if the invocation is: pgmReduce inputFile 5 outputFile
Q: What's the distinction between UNION and UNION ALL?
A: According to the question union and union all both are work on extract the row being specified in th...
Q: 9.29 - Fill out the tables (Raster Cell Values/Output Table) that result from the raster overlay sho...
A: Introduction Vector overlay operators are useful but geometrically complicated, and this sometimes r...
Q: The missing element in the following sequence 0,2,8,26,80, 728 is
A: The pattern is an = 3n-1 - 1
Q: In a full 4-ary tree, if the total number of leaves is 13, then the total number of edges = %3D O a....
A: e :- Number of edges n - number of vertices m - number of ary tree L - number of leaves e = n – 1 n ...
Q: When it comes to computer science, how would you address a situation in which an organisation curren...
A: answer is
Q: Which of the following staterments is not correct? O f the relation R on a set A is reflexive then t...
A: Sort Answer: option 1 is correct. If the relation R on a set A is reflexive then the complement rela...
Q: following represents a powerset of a set o (a) • (0, fa), (0,a}} Clear my choice The inverse of the ...
A: The given question is about the power set and the inverse proposition. The power set is a collection...
Q: A resistor, R = 4SN, and an inductor, L = 1.3H, are connected to form a low-pass filter. The current...
A: % define constant R = 4; L = 1.3; V = 12; % to store the i(t) it = []; t = 0:0.01:2; % time from 0 t...
Q: Based on this graph 2 3 Which of the following is true a) The degree of node 3 is 3 b) 3,4,4 is a si...
A: The answer is
Q: What pitfalls are in SAP implementations likely to encounter by VLF?
A: Below find the solution Factors leading to users without the required access include: The user was r...
Q: Given the circle radius r=20
A: Mid Point Circle Drawing Algorithm- Procedure- Given- Centre point of Circle = (X0, Y0) Radius of C...
Q: Types of Information System that APPLE INC. (AAPL) and MICROSOFT CORPORATION (MSFT) use?
A: answer is
Q: Describe the characteristics and duties of the data management system that solved traditional file m...
A: Security Management This is one of the foremost important functions within the DBMS. Security manage...
Q: How QPI can ensure data transfer of 8 GBPS with operation speed of 6GT/sec?
A: Answer : If instead you want to convert PCIe 2.x performances: PCIe 2.0 1x can handle up to: 5GT/s (...
Q: ated media communication, microwave communication vs satellite communication. Under what circumstanc...
A: This is about long-distance radiated media communication, microwave communication vs satellite commu...
Q: State & explain any three steps of data processing activity in any transaction processing system
A:
Q: Why is a foreign key so important to the integrity of a database? Could you give an example of why t...
A: A foreign key connection allows you to declare that a file in one table is associated with a list in...
Q: Why is edge flag algorithm advantageous? What are the benefits of edge flag algorithm?
A: Here,discuss about edge flag algorithm advantageous? What are the benefits of edge flag algorithm?
Q: As opposed to thinking of software development as a manufacturing process, think of it as a creative...
A: Software is a set of instructions that have been written and executed for a specific purpose. A soft...
Q: Which of the following is false O 35 div 8 = 4 a 219 mod 3 = 73 17 div 2 =8
A: The answer is
Q: 31 [1 2 0 2 3 x1 x2 X 3 6 = Lx3 x4] [4 2] The value of x3 = Note: Write only a number is the space p...
A: Ans : As per the given matrix Multiplication the value of x3 is 18
Q: A- System.out.print(Math.floor(5.7));
A: The floor() method returns a double result that has been rounded down. A mathematical integer will b...
Q: Convert the following hexadecimal expansion ( CA2 )16 to an octal expansion. Please break this one...
A: Steps: 1. First convert the given hexadecimal to binary 2. Now convert binary to octal
Q: a. explain the logic of why this code produces this output #include int f(int n,float x); main( ) ...
A: The Output :- 12 4 1 2 2 2 too small x=3.2 Explanation :- STEP1 :-Function call :-p=f(n,y);Here we ...
Q:
A: Here first do g(f(x)) then do this answer (h(x))
Q: CPU Datapath The following figure shows the overall datapath of the simple 5-stage CPU we have learn...
A: ANSWER: a) MUX 1 Input 1: Register A input 2:Register B b) MUX 2 Input 1: Register C input 2:Registe...
Q: Suppose you have a RISC machine with a 2.7 GHz clock (i.e., the clock ticks 2.7 billion times per se...
A: The answer is
Q: Debug the following bash script # Prompt the user and get input for NAME and store in a variable. Wr...
A: # Prompt the user and get input for NAME and store in a variable. Write this information in a file i...
Q: What is the basic idea behind Collins and Quillian’s semantic network approach? What is the goal of ...
A: Let's see the solution in the next steps
Q: Write a java application for performing edition subtraction and multiplication of complex numbers tr...
A:
Q: When the MPU starts up for the first time it goes to the and begins executing. Reset vector Interrup...
A: MPU is memory protection unit that provides memory protection.
Q: What Are the Users' Responsibilities During the Requirements Phase?
A: The main Users' Responsibilities During the Requirements Phase are :-
Q: Q-1. What is actput of this logic gate? A F=?
A:
Q: Figure out what kinds of connections there are between mobile devices and the cloud. What are the ad...
A: Answer : Private , public and hybrid connection are available between cloud and other devices.
Q: 3. Consider the abstract syntax for the following expression language. The constant Zero denotes 0, ...
A: Here we are given the syntax for the expression language and we need to find the semantics for it . ...
Q: 7. Write a program that will randomly generate 1000 uppercase letters. Write those alphabets in a te...
A: Introduction 7. Write a program that will randomly generate 1000 uppercase letters. Write those alph...
Q: Explain how the spiral model can support both the Waterfall model and the Prototyping model of the d...
A: Introduction: The waterfall paradigm is used when there is a minimal specification risk and no requi...
Q: Write a program to produce a table of numbers from 10 to 1, with their sq must look professional, wh...
A: The table of a number comprises a number multiplied by all numbers from 1 to 10. The C program is gi...
Q: Use the screenshot (alphabet) below to code a Depth-first search (DFS) algorithm in C++. Please expl...
A: Depth-first search is an algorithm for traversing or searching tree or graph data structures. The al...
Q: State the difference between parallel processors & coprocessors.
A: In the main processing computer has the arithmetic that can have parallel to the main processor of t...
Q: QUESTION 18 The following SQL Query: SELECT partname FROM quote WHERE UPPER(suppliername) = 'TOOL ...
A: The answer is
Q: Assume that the following graph represents a relation. Which of the following is true about the rela...
A: given the following graph represent a relation which of the following is true.
Q: Question 127: What Are The Security Group Features In Amazon Ec2?
A: Introduction: What Are The Security Group Features In Amazon Ec2?
Q: a have to create a program mmetric rod and the prograr
A: given - Project 2: You have to create a program in C language in which the user enters the mass M an...
Q: et A be an mxn matrix, and B be an pXm matrix, and C be an nXp matrix. Which of the following is not...
A: According to company guidelines we are restricted to answer only first question if the other questio...
Q: At the end of this and other textbooks, there usually is an index that lists the pages where a certa...
A: Step 1 : Start Step 2 : Define the function index which takes the filename and the list of the words...
Q: discuss how to creat a non-executable stack and disuss the stack's exploitable weaknesses
A: Insulation of wire is required to insulate the wire when it is in operating condition. It is essenti...
Q: Explain how to defeat a man-in-the-middle attack on a Wi-Fi network.
A: Introduction: A man-in-the-middle assault on a Wi-Fi network is defeatable.
Q: Question 9: Can S3 instances be cast-off with Ec2 instances, and if so, how?
A: Introduction: Can S3 instances be cast-off with Ec2 instances, and if so, how?
C
Write a programme called pgmReduce which takes 3 arguments:
1. an input file (either ASCII or binary)
2. an integer factor n, and
3. an output file
and reduces the input file by that factor in each dimension. For example, if the invocation is:
pgmReduce inputFile 5 outputFile
and inputFile is a 13x17 image, then outputFile should be a 2x3 image in which only the
pixels with row and column of 0 modulo 5 in the inputFile exist.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Create a program that reads three lines from a text file. Each line should be read one at a time. For each word on a line, the user should be asked to specify how many syllables are in that word. The program should then inform the user if the file contains a valid Hiku using the function below: def isHiku (firstLine, secondLine, thirdLine):if (firstLine == 5 and secondLine == 7 and thirdLine == 5): return True return False print("The file contains a Hiku:", isHiku(5,7,5))Note: You must replace the values in the function with the numbers counted by your program.This Python Lab 9 Lab: Write a file copying program. The program asks for the name of the file to copy from (source file) and the name of the file to copy to (destination file). The program opens the source file for reading and the destination file for writing. As the program reads each line from the source file and it writes the line to the destination file. When every line from the source file has been written to the destination file, it close both files and print “Copy is successful.” In the sample run, “add.py” is the source file and “add-copy.py” is the destination file. Note that both “add-copy.py” is identical to “add.py” because “add-copy.py” is a copy of “add.py”. Sample run: Enter file to copy from: add.py Enter file to copy to : add-copy.py Copy is successful. Source file: add.py print("This program adds two numbers") a = int(input("Enter first number: ")) b = int(input("Enter second number: ")) print(f"{a} + {b} = {a+b}") Destination file:…In C language, create a program that uses a standardized input method (input file with From To and Weight defined) to read in a text file. The text file will contain the name of the building and the distance from each building when running the program with the file, the program will read the information above and will ask users which buildings are they in and where they want to go to find the shortest path. then it will display the shortest route and the distance from the building that the user is at to the building that the user wants to go to
- 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 existJava Program /The Output attached by image OverviewYou should enter this task, ask the user for a word and then search for a file to see if that word is among the words in the file. Task This exercise comes with three text files named wordlist1.txt, wordlist2.txt and wordlist3.txt. These files contain a large amount of words in English. Each file contains more and more words. Each word in these files is on a separate line and the words contain only lowercase letters. Your task is to write a program that reads all these words from the file and checks if a keyword, which the user entered, is among the entered words. The program should also count the total number of words contained in the file used. The program should measure how long it takes to complete the search, ie how long it takes to read all the words and check if the keyword is among the words or not. The program should start by asking the user for the word to be searched for. Then the words in the file should be counted and…Java Program /The Output attached by image OverviewYou should enter this task, ask the user for a word and then search for a file to see if that word is among the words in the file. Task This exercise comes with three text files named wordlist1.txt, wordlist2.txt and wordlist3.txt. These files contain a large amount of words in English. Each file contains more and more words. Each word in these files is on a separate line and the words contain only lowercase letters. Your task is to write a program that reads all these words from the file and checks if a keyword, which the user entered, is among the entered words. The program should also count the total number of words contained in the file used. The program should measure how long it takes to complete the search, ie how long it takes to read all the words and check if the keyword is among the words or not. The program should start by asking the user for the word to be searched for. Then the words in the file should be counted and…
- Problem A straight line can be defined by a pair of points p1(x1, yı) and p2(x2, y2). The slope m of a line is defined as follow: У2 — У1 m = X2 - X1 Your program reads the points from a text file called 'points.txt’ which contains the coordinates of unknown number of pairs of points as shown in Figure 1. Each line contains four values x1, y1, x2, y2, where x1, yl are the coordinates of the first point and x2, y2 are the coordinates of the second point. 10 -2 7.5 -3.2 4 15.5 -4.6 21 -2 Зр 12.5 6. 2 5 -3 -6 10 3 10 15 Figure 1. Input file contains unknown number of point pairs Use Spider, to create the following files: (i) The input file 'points.txt' shown in Figure 1. Your Python program that reads from the input file 'points.txt', the coordinates of unknown number of pairs of points, computes the corresponding slopes then prints the results on the screen as shown in Figure 2. (ii) Line # X1 Y1 X2 Y2 slope 1 10.00 -2.00 7.50 -3.20 0.48 2 4.00 15.50 -4.60 21.00 -0.64 3 0.00 0.00 0.00…Problem A straight line can be defined by a pair of points p:(x1, yı) and p2(x2, y2). The slope m of a line is defined as follow: У — У X2 - X1 Your program reads the points from a text file called 'points.txt' which contains the coordinates of unknown number of pairs of points as shown in Figure 1. Each line contains four values x1, y1, x2, y2, where x1, yl are the coordinates of the first point and x2, y2 are the coordinates of the second point. m = 10 -2 7.5 -3.2 4 15.5 -4.6 21 -2 Зр 12.5 6 5 -3 -6 10 3 10 15 Figure 1. Input file contains unknown number of point pairs Use Spider, to create the following files: (i) The input file 'points.txt' shown in Figure 1. Your Python program that reads from the input file 'points.txt', the coordinates of unknown (ii) number of pairs of points, computes the corresponding slopes then prints the results on the screen as shown in Figure 2. ==== Line # X1 Y1 X2 Y2 Slope ========= ===== 10.00 0.48 -0.64 inf 1 -2.00 7.50 -3.20 4.00 -4.60 15.50 0.00…JAVA PPROGRAM Write a program that prompts the user to enter a file name, then opens the file in text mode and reads names. The file contains one name on each line. The program then compares each name with the name that is at the end of the file in a symmetrical position. For example if the file contains 10 names, the name #1 is compared with name #10, name #2 is compared with name #9, and so on. If you find matches you should print the name and the line numbers where the match was found. While entering the file name, the program should allow the user to type quit to exit the program. If the file with a given name does not exist, then display a message and allow the user to re-enter the file name. The file may contain up to 100 names. You can use an array or ArrayList object of your choosing, however you can only have one array or ArrayList. Input validation: a) If the file does not exist, then you should display a message "File 'somefile.txt' is not found." and allow the…
- You are required to implement a program which will read in a text file (.txt) containing words which are arranged in sentences. Your program should first ask the user for the name of the file and then count the number of individual words and characters (including numbers and punctuation) in the file. The word and character count result should be printed on the screen. Furthermore, your program should count the number of individual words starting with the letter 'A', 'B', 'C' and so on to 'Z'. Again, these statistics should be printed on the screen. Your program should display the letter that appears at the start of most words. The program must be written in C. You should illustrate the operation of your program by generating a text file containing 3 sentences from a lead news story on the day of testing.In C write a program that takes a file name and two strings as command line arguments, and writes the longer of the two strings to the file with the given name. If the given strings are the same length, write the first string given to the file. If the user does not provide the correct number of command line arguments, print an error message and exit the program with a non-zero exit code.Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate lists, and outputs the available food items in the following format: name (category) - description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character ('\t'). Ex: If the input of the program is: food.txt and the contents of food.txt are: Classic ham sandwich Available sandwich Chicken salad sandwich Not available Classic cheeseburger Cheeseburger Not available Salads Water 16oz bottled water Available Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Beverages Beverages Mexican food…