lab13_answers - Lab 13 Answer Sheet Name_Chuqian Huang...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab 13 Answer Sheet Name: ___Chuqian Huang_____________________ Netid: ___huang159____________ Section: __ADY_____ Part 1: Prelab Part A: Structures 1. Given the structures and variable declared above, complete the C code below by filling in the blanks to assign to the variable /mycd/ the following values: cdno = 100 , title = "Holding Onto Strings Better Left to Fray", sales for January = 2000.00 . Hint: use strcpy to assign strings. __ int mycd.cdno=100;_______________________________________ /* assign 100 to the cdno field of the variable named mycd */ _______strcpy=(mycd.title,"Holding Onto Strings Better Left to Fray");__ /* assign "Holding Onto Strings Better Left to Fray" to the title field */ _______float mycd.sales[0]=2000.00;__________________________________ /* assign 2000.00 to the first element of the sales array */ 2. Continuing from question 1, complete the C code below by filling in the blanks to assign to the variable /mycd/ the following values: for the 14th track, name = "Country Song", length = 349. Hint: indexing in arrays start with 0. __strcpy(mycd.tracks[13].name,"Country Song");___________________________________ /* assign "Country Song" to the name field of the 14th track of the variable named mycd */ ___int mycd.tracks[13],length=349;__________________________________ /* assign 349 to the length field of the track */ 3. Given the structures defined before question 1, and given the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

lab13_answers - Lab 13 Answer Sheet Name_Chuqian Huang...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online