Monash University > CSSE > CSE1303 > Part A > Tutorials > Tutorial A1

CSE1303 Computer Science
Summer Semester, 2003
Part A
Tutorial A1 : Revision

This tute covers material from lectures A01 to A02.

There may not be time in the tutorial to cover all of these questions. Attempt at least the ones marked with an asterisk before the tutorial; these are the ones that will be focussed on during the class. If you have specific questions about unmarked questions, you can ask the tutor about them during the tutorial. If you want further revision questions, suggestions of questions from the textbooks are provided at the end of the tutorial sheet.


Note: The purpose of tutorials is not simply to give you the answers to these questions! (Solutions will be released in about a week online, so if all you want is the answers, there are easier ways.)


Exercise 1

* Exercise 2

  1. Write a C function which is given a positive number of seconds, and returns the equivalent hours, minutes and seconds. The values of the minutes and seconds returned must be non negative and less than 60.

  2. Write a main function in C which implements a menu that prompts the user to chose to enter a positive number of seconds or exit the program.

* Exercise 3

* Exercise 4

Exercise 5

* Exercise 6

Exercise 7

Exercise 8

  1. What is the difference between an array of characters and a string?

  2. Can you use the functions contained in <string.h> to manipulate arrays of characters (not strings)? Why or why not?

  3. What will the following line print if list is an array of characters (not a string)?

  4. Given the following lines of C code: And the input "Unfinished Tales", what will happen to the variable word and the memory around that variable?

 

ADDITIONAL EXERCISES

[ Top | Home ]

Last modified: Tuesday 02 December 2003 22:29:33