Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
: A monochrome screen is stored as a single array of bytes, allowing eight consecutive
pixels to be stored in one byte. The screen has width w, where w is divisible by 8 (that is, no byte will
be split across rows). The height of the screen, of course, can be derived from the length of the array
and the width. Implement a function that draws a horizontal line from (xl, y) to (x2, y).
The method signature should look something like:
drawLine(byte[] screen, int width, int xl, int x2, int y)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
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
- Problem D. 73511. Quarters Input file: Out put file: Time limit: Memory limit: standard input standard output 1 second 256 megabytes In this task, you have to generate a two-dimensional array of n rows and m columns in the following way. Let's pass two lines through our two-dimensional array horizontally and vertically, both cutting the array in the middle. Formally, these are the horizontal line after -th row and the vertical line after -th column (n and m are even). Now we have four parts of the array: right-upper quarter, left-upper quarter, left-lower quarter and right- lower quarter. Fill the right-upper quarter with 0-s, the left-upper quarter with 1-s, the left-lower quarter with 2-s, the right-lower quarter with 3-s. For clearance, see the examples below. Input The first line of input contains two-separated positive even integers n and m – the number of rows and columns respectively (2 < n, m < 100). Output Output n lines each containing m space-separated integers – the…arrow_forwardSuppose a numeric array (A) having M elements. Write a code Program to calculate the elements of the numeric array C, where a numeric array C is determined from the following formula: [C]=[A]*[A]T. Print a numeric array C.arrow_forwardCreate a program that reads in an array of strings (AKA a 2D array of char ). The strings should be read through a function that reads a single string at a time, assuming the original array still has space. For example, given a 20 amay of char with size 4x 32 it can store up to 4 strings of length 31. When you first create the array, there are no strings Reading a string using the function should increase the number of strings by 1. If 4 strings have already been read the function should not try and read a new string Define the following function in a file named string_utils.c with its declaration in string_utils.h . In string_utils.h, define MAXSTRINGS = 4 and STASIZE = 32.arrow_forward
- write a c++ program: Create an array with 11 integers, which will be randomly selected from the range of 0 to 100. Print the items of the array on screen as one line. Develop a function that takes the array as argument and perform these operations: -Find the minimum of array items and replace (swap) with first item of the array. -Find the maximum of array items and replace (swap) with last item of the array. -Find the average of array’s items and assign it to middle location of the array. The average of numbers should be calculated as an integer. (hint: static_cast<int>(float))arrow_forwardan int variable k, an int array currentMembers that has been declared and initialized, an int variable nMembers that contains the number of elements in the array, an int variable memberID that has been initialized, and a bool variable isAMember, Write code that assigns true to isAMember if the value of memberID can be found in currentMembers, and that assigns false to isAMemberotherwise. Use only k, currentMembers, nMembers, and isAMember.arrow_forwardIn a one-dimensional array, one-year average daily temperature information of the city of Karabük is kept. The average daily temperature information is between -25 and 35 degrees. Accordingly, write a function that takes this array as a parameter and finds the number of temperatures between [-25, -10), [-10, 5), [5, 20) and [20, 35] values and prints it to the screen in that order. Sample Output ( Example Output ): [-25, -10) : 13 [-10, 5) : 93 [5, 20) : 117 [20, 35] : 142arrow_forward
- Create a function using Java: Number of Rows = 3-6 Number of Columns = 3-6 Function Name: winInDiagonalFSParameters: board: 2D integer array, piece: integerReturn: booleanAssume board is valid 2D int array, piece is X==1/O==2.Look at all forward slash / diagonals in the board. If any forward slash / diagonals has at least 3consecutive entries with given type of piece (X/O) (3 in a row XXX, OOO), then return true,otherwise falsearrow_forwardYou’re writing a function that accepts an array of unsorted integers and returns the length of the longest consecutive sequence among them. The sequence is formed by integers that increase by 1. For example, in the array: [10, 5, 12, 3, 55, 30, 4, 11, 2] the longest consecutive sequence is 2-3-4-5. These four integers form an increasing sequence because each integer is one greater than the previous one. While there’s also a sequence of 10-11-12, it’s only a sequence of three integers. In this case, the function should return 4, since that’s the length of the longest consecutive sequence that can be formed from this array. One more example: [19, 13, 15, 12, 18, 14, 17, 11] This array’s longest sequence is 11-12-13-14-15, so the function would return 5. Your job is to optimize the function so that it takes O(N) time.arrow_forwardThe purpose is to write a program with 2D arrays that will display Knight's Tour. Knight's Tour is a fascinating problem that is done on an electronic chessboard with a knight. Starting at any location on the chessboard, a knight proceeds to move on the board in such a manner that all positions on the chessboard are visited, once and once only. The knight may only move according to the rules of chess playing. The matrixes below show a sequence of knight moves that starts from the top-left corner. In most cases, the knight is locked in place and can go no farther. Note: there are only 3 legal knight moves from the 44 locations and they have already been visited. 01 60 39 34 31 18 09 6438 35 32 61 10 63 30 1759 02 37 40 33 28 19 0836 49 42 27 62 11 16 2943 58 03 50 41 24 07 2048 51 46 55 26 21 12 1557 44 53 04 23 14 25 0652 47 56 45 54 05 22 13 01 22 39 20 03 18 09 1600 37 02 23 08 15 04 1335 40 21 38 19 12 17 1000 00 36 41 24 07 14 0500 34 00 32 00 28 11 2600 00 00 00 42 25 06 2900…arrow_forward
- The purpose is to write a program with 2D arrays that will display Knight's Tour. Knight's Tour is a fascinating problem that is done on an electronic chessboard with a knight. Starting at any location on the chessboard, a knight proceeds to move on the board in such a manner that all positions on the chessboard are visited, once and once only. The knight may only move according to the rules of chess playing. The matrixes below show a sequence of knight moves that starts from the top-left corner. In most cases, the knight is locked in place and can go no farther. Note: there are only 3 legal knight moves from the 44 locations and they have already been visited. 01 60 39 34 31 18 09 6438 35 32 61 10 63 30 1759 02 37 40 33 28 19 0836 49 42 27 62 11 16 2943 58 03 50 41 24 07 2048 51 46 55 26 21 12 1557 44 53 04 23 14 25 0652 47 56 45 54 05 22 13 01 22 39 20 03 18 09 1600 37 02 23 08 15 04 1335 40 21 38 19 12 17 1000 00 36 41 24 07 14 0500 34 00 32 00 28 11 2600 00 00 00 42 25 06 2900…arrow_forwardPlease explain the stepsarrow_forwardWrite a program in C language that takes 10 characters from user in an array. After receiving input from user pass that array to a function “boolean checkmyString(char arr[])”. This function will match the array to a given pattern “1A&^@AXgkj” and returns true or false. If the checkmyString function returns true print “Password Match Successful” and print “Try Again”. The program will keep on asking for new inputs until the functions returns true.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