EBK COMPUTER SCIENCE: AN OVERVIEW
12th Edition
ISBN: 8220102744196
Author: BRYLOW
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 8.7, Problem 3QE
Using the extensions described at the end of this section, write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write a program that will take n floating point numbers as input and print the sum, average and maximum of the numbers. Use dynamic memory allocation and pointers to do the task. Sample input file: 5 12 24 34 45 56 Sample output file: Sum : 171.0 Average : 34.2 Maximum : 56
Numbers between 0 and 15 are stored in the memory location starting from physical address B000Fh randomly. Write a program which finds the element order number in the string starting from 0 to 15 and writes to physical address C000Fh. (Eg: "1" is 2nd element in the first string, "2" is 4th element, ....etc)
The program below uses pointer arithmetic to determine the size of a 'char' variable. By using pointer arithmetic we can find out the value of 'cp' and the value of 'cp+1'. Since cp is a pointer, this addition involves pointer arithmetic: adding one to a pointer makes the pointer point to the next element of the same type. For a pointer to a char, adding 1 really just means adding 1 to the address, but this is only because each char is 1 byte. Compile and run the program and see what it does. Write some code that does pointer arithmetic with a pointer to an int and determine how big an int is. Same idea – figure out how big a double is, by using pointer arithmetic and printing out the value of the pointer before and after adding 1. What should happen if you added 2 to the pointers from exercises 1 through 3, instead of 1? Use your program to verify your answer
#include <stdio.h>int main( ) { char c = ‘Z’; char *cp = &c; printf("cp is 0x%08x\n", cp); printf("The character…
Chapter 8 Solutions
EBK COMPUTER SCIENCE: AN OVERVIEW
Ch. 8.1 - Give examples (outside of computer science) of...Ch. 8.1 - Prob. 2QECh. 8.1 - Prob. 3QECh. 8.1 - Prob. 4QECh. 8.1 - Prob. 5QECh. 8.2 - In what sense are data structures such as arrays,...Ch. 8.2 - Prob. 2QECh. 8.2 - Prob. 3QECh. 8.3 - Prob. 1QECh. 8.3 - Prob. 2QE
Ch. 8.3 - Prob. 3QECh. 8.3 - Prob. 4QECh. 8.3 - Modify the function in Figure 8.19 so that it...Ch. 8.3 - Prob. 7QECh. 8.3 - Prob. 8QECh. 8.3 - Draw a diagram representing how the tree below...Ch. 8.4 - Prob. 1QECh. 8.4 - Prob. 2QECh. 8.4 - Prob. 3QECh. 8.4 - Prob. 4QECh. 8.5 - Prob. 1QECh. 8.5 - Prob. 3QECh. 8.5 - Prob. 4QECh. 8.6 - In what ways are abstract data types and classes...Ch. 8.6 - What is the difference between a class and an...Ch. 8.6 - Prob. 3QECh. 8.7 - Suppose the Vole machine language (Appendix C) has...Ch. 8.7 - Prob. 2QECh. 8.7 - Using the extensions described at the end of this...Ch. 8.7 - In the chapter, we introduced a machine...Ch. 8 - Prob. 1CRPCh. 8 - Prob. 2CRPCh. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 4CRPCh. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 6CRPCh. 8 - Prob. 7CRPCh. 8 - Prob. 8CRPCh. 8 - Prob. 9CRPCh. 8 - Prob. 10CRPCh. 8 - Prob. 11CRPCh. 8 - Prob. 12CRPCh. 8 - Prob. 13CRPCh. 8 - Prob. 14CRPCh. 8 - Prob. 15CRPCh. 8 - Prob. 16CRPCh. 8 - Prob. 17CRPCh. 8 - Prob. 18CRPCh. 8 - Design a function to compare the contents of two...Ch. 8 - (Asterisked problems are associated with optional...Ch. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 22CRPCh. 8 - Prob. 23CRPCh. 8 - Prob. 24CRPCh. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 26CRPCh. 8 - Prob. 27CRPCh. 8 - Prob. 28CRPCh. 8 - Prob. 29CRPCh. 8 - Prob. 30CRPCh. 8 - Design a nonrecursive algorithm to replace the...Ch. 8 - Prob. 32CRPCh. 8 - Prob. 33CRPCh. 8 - Prob. 34CRPCh. 8 - Draw a diagram showing how the binary tree below...Ch. 8 - Prob. 36CRPCh. 8 - Prob. 37CRPCh. 8 - Prob. 38CRPCh. 8 - Prob. 39CRPCh. 8 - Prob. 40CRPCh. 8 - Modify the function in Figure 8.24 print the list...Ch. 8 - Prob. 42CRPCh. 8 - Prob. 43CRPCh. 8 - Prob. 44CRPCh. 8 - Prob. 45CRPCh. 8 - Prob. 46CRPCh. 8 - Using pseudocode similar to the Java class syntax...Ch. 8 - Prob. 48CRPCh. 8 - Identify the data structures and procedures that...Ch. 8 - Prob. 51CRPCh. 8 - In what way is a class more general than a...Ch. 8 - Prob. 53CRPCh. 8 - Prob. 54CRPCh. 8 - Prob. 55CRPCh. 8 - Prob. 1SICh. 8 - Prob. 2SICh. 8 - In many application programs, the size to which a...Ch. 8 - Prob. 4SICh. 8 - Prob. 5SICh. 8 - Prob. 6SICh. 8 - Prob. 7SICh. 8 - Prob. 8SI
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
The text file babynames2012.txt, which is included in the source code for this book and is available online fro...
Problem Solving with C++ (10th Edition)
Revise the following code so that it uses a while loop instead of a do-while loop: Scanner keyboard = new Scann...
Java: An Introduction to Problem Solving and Programming (8th Edition)
The 50-mm-diameter cylinder is made from Am 1004-T61 magnesium and is placed in the clamp when the temperature ...
Mechanics of Materials (10th Edition)
ICA 8-8
If the density of sodium is 98 kilograms per cubic meter [kg/m3], what is this in slugs per gallon [slu...
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
This optional Google account security feature sends you a message with a code that you must enter, in addition ...
SURVEY OF OPERATING SYSTEMS
Describe the common components needed to create a Web-based application.
Modern Database Management
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 program that performs a calculation on two byte arrays. *****Please use assembly code for ATMEGA2560. 4Y - X/3 = R X is an element of the first array, Y is an element of second array, and R is an element of the result array. Store the result as an integer word. Define the arrays X and Y as: X = .DB 1, 12, 33, 54, 75, 96, 117, 138, 159, 170, 191, 212, 223 Y = .DB -121, -102, -83, -64, -45, -26, 7, 28, 49, 60, 81, 102, 123arrow_forwardWrite a program-using pointer to display the value and memory address of x? If x = 4d - 2f + 7rarrow_forward45. Given an array A(I) of 100 16-bit signed numbers stored in memory starting at address A00016, write a program to generate two arrays from the given array such that one array P(J) consists of all the positive numbers and the other N(K) contains all the negative numbers. Store the array of positive numbers in memory starting at offset address B00016 and the array of negative numbers starting at offset address C00016-arrow_forward
- *Student information is being held in a data area, where each student record has the following format: The first nine bytes are the student number, held in ASCII The next byte is the course mark The next word is the section identifier 10009. There are well over three hundred such student records that have been loaded sequentially into memory starting at address $10000. The last record loaded is a dummy record with a section identifier of $FFFF, to show the end of the rècords. If a2 has the address of a student record, what is the location of the next record in the array / data area. Explain your answer.arrow_forwardWrite a Program to sort integer element of three digits Using Dynamic Memory Allocation. To perform this program, allocate memory dynamically using malloc() function and before exiting the program we will release the memory allocated at run time by using free() function.arrow_forwardPlease help with creating the code as follows: Task 1: Write a program DFT-Horner to evaluate a given polynomial at the n complex roots of unity using Horner’s rule. This is just computing the DFT of the coefficients of the polynomial.Input: Input for this program will be the coefficients of the polynomial represented as a sequence of n (complex) numbers in a file, where each component is a double. (A real coefficient will be represented by a single component, and a complex coefficient will be represented by two components.)Output: Output for this program will be the evaluations of the polynomial a(x) at the n complex roots of unity, i.e., DF Tn(a). The program should output the n components of the DFT. Each component should contain both real and imaginary parts, both rounded to 3 decimal places.Example: The polynomial a(x) = 1+2x+3x2 can be represented as a coefficient vector a = (1.000, 2.000, 3.000). The DFT of the coefficients of a is the vector (6.000 + 0.000i, −1.500 − 0.866i,…arrow_forward
- Write a program that opens a file for read, reads the data in from the file and calculates the sum of the row values. The data is all integers with 7 values per line, and 10 lines of data in the file. The program must use two functions, one to open the file, and another to output and calculate the sum of the row values. All data must be read into a two dimensional array first, then the data is output and the sum calculated. The data should be printed out by row, along with the sum of the row values. Prototypes void rowSumCalculator( int myArray[][10], int rowCount, int colCount ); Function rowSumCalculator( ) writes out the data in the array and the sum of the values in the row. void openFile( ifstream& infile, string prompt ); Function openFile should print the prompt out to the user, read in the filename and open the file. If the file does not open, an error is written to the display, and the user prompted again. The function does not return until a file have been opened. Example…arrow_forwardIn this assignment you will write a program that encrypts a text file. You will use the following encryption scheme. 1. Ask the user for the name of the original file. 2. Ask the user for the name of the output file. 3. Ask the user for the encryption key, n. 4. Read n² characters from the file into the n rows and n columns of a 2-dimensional array row by row. 5. Write the characters from the array to an output file column by column. 6. Repeat steps 4-6 until the entire input file has been read. This same program can be used to decrypt a file that has been encrypted in this way. Your program should have functions for performing the following tasks. 1) Reading the characters from the file into the array. This function should be passed the file stream, the array and the key. 2) Writing the characters from the array to the file. This function should be passed the file stream, the array and the key. Your main function should get the filenames, open the files, get the key, dynamically…arrow_forward5.How many bytes in the memory will be occupied by short int array[10] 10 Bytes 20 Bytes 40 Bytes 60 Bytes 6.Given the definition void myFunc(int a, int* b , int* c)which statement is true The values of the aliases a, band c are available to the function Only the addresses of the variables b, care available to the function myFunccannot change the variable whose value is copied to a myFunc can change the value of the variable whose address is copied into b all of the abovearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Instruction Format (With reference to address); Author: ChiragBhalodia;https://www.youtube.com/watch?v=lNdy8HREvgo;License: Standard YouTube License, CC-BY