CS 325 Software Development and Systems - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

CS 325 Software Development and Systems

Description:

Be sure to turn in implementation skeletons by Friday with comments (incoming, ... Write a function add that takes two strings and appends the 2nd string to the first ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 9
Provided by: janett
Category:

less

Transcript and Presenter's Notes

Title: CS 325 Software Development and Systems


1
CS 325 Software Development and Systems
2
  • Go ahead and open Visual Studio and the files
    List1.cpp and List2.cpp

3
Lecture 18
  • Today
  • More practice with linked lists
  • Test 3 will be Tuesday, Nov. 16
  • Project 5 is due Wednesday, Nov. 17 _at_1159 pm
  • Be sure to turn in implementation skeletons by
    Friday with comments (incoming, outgoing,
    purpose)
  • Chapter 9 after exam3 - Inheritance

4
Class Exercises
  • int main()
  • int size
  • cout ltlt "How many elements do you need in your
    list?" ltlt endl
  • cin gtgt size
  • // declare an array that allocates space for
    size integers
  • // put code to get integers from user here
  • // put code to print ray here without using the
    notation
  • return 0

5
Practice with Concatenation
  • String concatenation allows us to add two
    string together.
  • Write a function add that takes two strings and
    appends the 2nd string to the first

6
Trace the code
  • include ltiostream.hgt
  • include ltstring.hgt
  • void stuff(char, char, char)
  • void morestuff(char)
  • int main()
  • char str17"111 char str23"22 char
    str34"3"
  • stuff(str1,str2,str3)
  • return 0
  • void morestuff(char s)
  • if (strlen(s)gt0)
  • morestuff(s1)
  • cout ltlt s ltlt endl
  • void stuff(char s1, char s2, char
    s3)
  • strcat(s3,s2)
  • strcat(s1,s3)
  • morestuff(s1)

7
More practice
  • Using the code from previous classes concerning
    linked lists (class List2)
  • Implement a method that inserts an element in
    order of the value in the node.
  • Write a method that will count the number of
    elements (nodes) in the linked list
  • Implement delete methods
  • Delete from beginning (delBeg)
  • Delete from end (delEnd)
  • Delete node whose value is given at the call of
    the delete method (delNodeWith(int))

8
End of Lecture 18
  • Chapter 9 after exam3 - Inheritance
Write a Comment
User Comments (0)
About PowerShow.com