Midterm Review Questions

From Maryville College CS Wiki
Jump to: navigation, search

  1. How do you declare a main function in C++?
  2. How do you declare an integer, double, character, and string variable in C++?
  3. What is an array?
  4. How does a C++ string differ from a character array?
  5. An object contains what two things?
  6. What does the public access modifier do?
  7. What does the private access modifier do?
  8. What is the relationship between classes and objects in C++?
  9. How many constructors can a class have?
  10. How do you invoke the constructor on a class?
  11. What are pointers?
  12. How can you dynamically allocate an int, double, or character?
  13. How can you dynamically allocate an array of a given type?
  14. How can you pass constructor arguments into a class when dynamically allocating an object?
  15. How do you deallocate objects/primitive typed variables?
  16. How do you deallocate arrays?
  17. What does the new operator do?
  18. What does the delete operator do?
  19. What are valid arguments to the delete operator?
  20. What is the relationship between pointer arithmetic and array indexing?
  21. What is FLTK?
  22. What is a widget?
  23. How do you create a window in FLTK?
  24. How do you add widgets to a window in FLTK?
  25. How do you finish and show a window in FLTK?
  26. What is a callback?
  27. What is inheritance?
  28. What is polymorphism?
  29. Briefly describe what a virtual function?
  30. An abstract class contains what kind of function?
  31. How does polymorphism get used when creating custom widgets in FLTK?
  32. Be able to write code that declares a class and creates an object of that class.
  33. Be able to construct a program which creates and shows a small FLTK window with a couple of widgets. (It will include nothing more than the Fl_Window, Fl_Button, Fl_Output, and Fl_Input widgets)