1. Name this program one. c - Complete the program shown below. #include #include typedef struct...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Name this program one. c - Complete the program shown below. #include <stdio.h> #include <stdlib.h> typedef struct letter { char ch; struct letter *next; } Letter; int main (void) { Letter a, b, c, a.ch = 'D' ; b.ch = '0'; c.ch = 'R'; 'M'; d. ch= e.ch = 'I'; f.ch = 'T'; f.next = &g; g.ch = '0'; g.next=&h; h.ch= 'R'; h. next = &i; i.ch = 'Y'; i.next = NULL; Letter *ptr = &a; while ( ptr != NULL ) { d, e, f, g, h, i; a.next = &b; b. next = &c; c. next = &d; d. next = &e; e.next = &f; printf("%c ", ptr->ch); ptr = ptr->next; } printf ("\n"); // rearrange pointers so that it spells "DIRTYROOM" ptr = &a; while (ptr != NULL) { printf("%c", ptr->ch); ptr = ptr->next; } printf ("\n"); return 0; 2. Name this program two.c - In your one. c program, replace the line shown in blue below with the line shown in red. Modify the rest of your program (including insertion of the necessary malloc statements) so that your program runs the same as your one. c program runs. Letter a, b, d, e, f, g, h, i; Letter *a, *b, *c, *d, *e, *f, *g, *h, *i; 3. Name this program three.c-Repeat program two.c using an array of thirteen "Letters" that initially contains the phrase ELEVENPLUSTWO (allocate space, assign values, print the list). Then modify pointers in the data array so that it says TWELVEPLUSONE. Print this revised list. Hint - your second print loop would start at data[10] if you encoded the original message in location 0..12 of the data array. Letter *data [13]; For all problems, modify pointers to transform the word. Modifying character values is unacceptable. 1. Name this program one. c - Complete the program shown below. #include <stdio.h> #include <stdlib.h> typedef struct letter { char ch; struct letter *next; } Letter; int main (void) { Letter a, b, c, a.ch = 'D' ; b.ch = '0'; c.ch = 'R'; 'M'; d. ch= e.ch = 'I'; f.ch = 'T'; f.next = &g; g.ch = '0'; g.next=&h; h.ch= 'R'; h. next = &i; i.ch = 'Y'; i.next = NULL; Letter *ptr = &a; while ( ptr != NULL ) { d, e, f, g, h, i; a.next = &b; b. next = &c; c. next = &d; d. next = &e; e.next = &f; printf("%c ", ptr->ch); ptr = ptr->next; } printf ("\n"); // rearrange pointers so that it spells "DIRTYROOM" ptr = &a; while (ptr != NULL) { printf("%c", ptr->ch); ptr = ptr->next; } printf ("\n"); return 0; 2. Name this program two.c - In your one. c program, replace the line shown in blue below with the line shown in red. Modify the rest of your program (including insertion of the necessary malloc statements) so that your program runs the same as your one. c program runs. Letter a, b, d, e, f, g, h, i; Letter *a, *b, *c, *d, *e, *f, *g, *h, *i; 3. Name this program three.c-Repeat program two.c using an array of thirteen "Letters" that initially contains the phrase ELEVENPLUSTWO (allocate space, assign values, print the list). Then modify pointers in the data array so that it says TWELVEPLUSONE. Print this revised list. Hint - your second print loop would start at data[10] if you encoded the original message in location 0..12 of the data array. Letter *data [13]; For all problems, modify pointers to transform the word. Modifying character values is unacceptable.
Expert Answer:
Answer rating: 100% (QA)
One c include include typedef struct letter char ch struct letter next Letter int mainvoid Letter a ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
solve a somewhat larger problem whose solution incorporates the programming concepts that you have been studying: Variables, Data Types, Control Structures (if-then, if-then-else, loops, switch,...
-
if we choose statistic as our keyword, our cipher would be determined as follows: method i. write the word statistic without the repeated letters. then complete the cipher with the unused alphabet...
-
Calculate the Return on Invested Capital Cash Receivables Inventory Total current assets Net fixed assets Total assets Sales Cost of goods sold: Materials Labor Heat, light, and power Indirect labor...
-
Tatum is a consultant at R.G. & Company (R.G.), a global consulting firm. She has enjoyed the past few years working at the company. As an ambitious person, she has been focusing on her long-term...
-
A certain electronic device needs to be protected against sudden surges in current. In particular, after the power is turned on, the current should raise no more than 7.5 mA in the first 120s. The...
-
A parallel plate capacitor is constructed from two square conducting plates of length L = 0.10 m on a side. There is air between the plates, which are separated by a distance d = 89μm....
-
Use the data in Exercise 26 in Section 13.1 for the following. a. Compute a point estimate for the mean evaporation rate when the temperature is 20C. b. Construct a 99% confidence interval for the...
-
The following items were selected from among the transactions completed by Sherwood Co. during the current year: Mar. 1. Purchased merchandise on account from Kirkwood Co., $225,000, terms n/30. 31....
-
Zechariah Company provides an incentive compensation plan under which its president received a bonus equal to 10% of the corporation's income before income tax but after deduction of the bonus. If...
-
Crane Library, a nonprofit organization, presented the following statement of financial position and statement of activities for its fiscal year ended February 28, 2024. Assets Current Assets Cash...
-
Identify the acid and base reactants in the following reaction:
-
One 3.2-kg paint bucket is hanging by a massless cord from another 3.2-kg paint bucket, also hanging by a massless cord. ) If the two buckets are pulled upward with an acceleration of 1.25 m/s by the...
-
In the closed loop negative feedback system whose block diagram is given in the figure; The transfer and the transfer function of the control = function of the controlled system is defined as G, (s):...
-
(a) What is the momentum in kg m/s of a garbage truck that is 1.30 x 104 kg and is moving at 31.0 m/s? (Enter a number.) 40.3 xkg m/s (b) At what speed in m/s would an 8.00 kg trash can have the same...
-
ABC Company wants to value its company based on 5 years of forecast Free Cash Flows, including a Terminal Value (using the Perpetuity Growth Model) in Year 5.Given the following information,...
-
6.45 - You and your friend Peter are putting new shingles on a roof pitched at 23. You're sitting on the very top of the roof when Peter, who is at the edge of the roof directly below you, 5.3 m...
-
Calculate the potential difference between two points. distance TA & To from infinitely long uniformly charged wire with live charge density f A & B at a
-
Why is it important to understand the macro-environment when making decisions about an international retail venture?
-
Dr. Ivan I. Incisor and his wife Irene are married and file a joint return for 2012. Ivan's Social Security number is 477-34-4321 and he is 48 years old. Irene I. Incisor's Social Security number is...
-
Mallory Corporation has a calendar year-end. The corporation has paid estimated payments of $10,000 during 2012 but still owes an additional $5,000 for its 2012 tax year. a. When is the 2012 tax...
-
Marty is a sales consultant. Marty incurs the following expenses related to entertainment of his clients in 2012: Dues to a country club......................................................$4,500...
-
You are the senior partner of a large, local audit firm. In reviewing the work of a junior staff member on a compilation engagement for Greasemonkey's Delight Inc., a local autoparts store (in which...
-
You have been assigned to audit the accounts payable of Slamtastic, a small recording company specializing in alternative music. Following is a portion of their accounts payable journal for the month...
-
The chapter discussed three issues to consider when obtaining evidence using a sample-based audit procedure: a. The number of transactions or items to examine b. The actual transactions or items to...
Study smarter with the SolutionInn App