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...
-
Darwin Inc. sells a particular textbook for $30. Variable expenses are $23 per book. At the current volume of 55,000 books sold per year the company is just breaking even. Given these data, the...
-
Stanford issues bonds dated January 1, 2015, with a par value of $500,000. The bonds annual contract rate is 9%, and interest is paid semiannually on June 30 and December 31. The bonds mature in...
-
What steps should Richard Booth take to investigate further the problems highlighted by his initial research, while at the same time gaining the cooperation of the sales force? In your answer...
-
1. Design tables in 3NF. As you create the database, include various codes for at least three of the fields. 2. Use sample data to populate the fields for at least three records in each table. 3....
-
Air at 101.325 kPa, 20C is taken into a gas turbine power plant at a velocity of 140 m/s through an opening of 0.15 m 2 cross-sectional area. The air is compressed heated, expanded through a turbine,...
-
Using data in Exhibit 1, calculate Coxs break-even point in sales dollars (per hen). Taking into account his cumulative revenue for a hen, during which week (approximately) will the break-even point...
-
Crafty Chocolate Company ('Crafty') has developed a new type of chocolate that they claim causes weight loss. The product is called 'Chocoslim'. Crafty has developed a series of television...
-
A European-style bond carries a 7% coupon rate, a face value of $1,000, and has 10 years until it matures. If the bond is currently trading at a price of $1200, what is the nominal yield to maturity...
-
A CMO has three tranches. Tranche A has a principal of $40.94 million at an annual coupon of 7.69%. Tranche B has a principal of $36.47 million at an annual coupon of 9.43%. Tranche Z has a principal...
-
A new three-year CMO has two tranches. The 'A' tranche has a principal of $59.5 million with an annual-coupon of 5.41%. The 'Z' tranche has a coupon of 7.37% with a principal of $67.1 million. The...
-
How many new shares did your contribution buy? Image transcription text 2. On Feb 15, if EIF costs $40/share. a. How many new shares did your contribution buy? b. How many total shares do you now...
-
Paul Down and Eileen Dover are married. Paul Down is 67 years old, while Eileen Dover is 66 years old. Paul Down is blind, but Eileen Dover is not. They properly claim Paul Down's father--who is 88--...
-
A 25-year-old man was found dead at home by the apartment manager, who had been called by the decedent's employer because of failure to report to work for the past 3 days. An external examination by...
-
Review Exhibit 11.4. Analyze each product on the graph according to the characteristics that influence the rate of adoption. For example, what can you conclude from the data about the relative...
-
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...
-
What are the PMI and PRINCE2?
-
What are the differences between a framework, a methodology and a standard?
-
Individually identify what you consider to be the greatest achievements accomplished by human kind in the last decade. Now share your list with other students in the class and come up with an...
Study smarter with the SolutionInn App