need some help for class project

hello everybody. this site is the only reason I know as much as I do about c++. my teacher/grad assistant that teaches my class is very competent and knows his stuff, but he can't teach his way out of a paper bag. this is a project that is due this friday. usually my biggest problem is starting the h/w's or projects. so i figure ill try this forum. post what you want, help is appreciated.

1.)
Write a function that accepts 3 parameters: hours, minutes, and elapsed time.
Elapsed time is an integer number of minutes to be updated based on the time passed in through hours
and minutes. Here is an example:

Before call: hours = 12 minutes = 44 elapsed_time = 198
After call: elapsed_time = 962



After you have written your function you need to write a loop that will read a list of
hours and minutes from a file until the end of file is encountered.
You will read the data from the main and make a function call for each set of
data read from the file.

initialize elapsed time to 0

Read the data from Ex3.in and assume there are the following 3 data sets ( hours min):
44 53
2 45
64 34

Your program should be able to run on any input of valid data sets.
( If I gave you a set of 100 or 1,000 data sets your program should produce the results )

Print the results for each data set specifying the elapsed time.


(Save as Ex1.cpp) ( Send to Ex1.dat)


2.)

Write a function that accepts a two dimensional array of chars and two integers as arguments.
The function should use a nested for loop to assign characters into the array.
The dimensions of the figure will be passed as arguments to the function.
The 3 arguments for your first function should be height and width (ints) and
a two dimenstional array.

The first function prototype is:
void Matrix_initialize(char a[ ][MAX_COLS], int height, int width);

You then need to print a second function that prints
the matrix. One of the arguments for the 2nd function should be
a refernce parameter for an output file stream.

The reference parameter should be able to accept either
an ofstream variable or cout.

The second function prototype is:
void print_matrix_triangle(char a[ ][MAX_COLS], int height, int width, /*YOU FILL THIS IN*/);

Examples:

if I make the following function calls (from the main):

Matrix_initialize(a, 9, 6);
print_matrix_triangle(a, 9, 6, cout);

Note: ! is the exclamation mark
The output to the terminal should be


!
! ! !
! ! ! ! !
! ! ! ! ! !
! ! ! ! ! !
! ! ! ! ! !
! ! ! ! ! !
! ! ! ! ! !
! ! ! ! ! !



If I make the following function calls from the main

Matrix_initialize(a, 5, 5);
print_matrix_triangle(a, 5, 5, cout);


The output to the terminal should be


!
! ! !
! ! ! ! !
! ! ! ! !
! ! ! ! !


For this program the width can be greater than the heigth.

The following result would occur with the function calls:

Matrix_initialize(a, 5, 9);
print_matrix_triangle(a, 5, 9, cout);


!
! ! !
! ! ! ! !
! ! ! ! ! ! !
! ! ! ! ! ! ! ! !



you can use a static array
Use the following global constants for
declaring the array size:

const int MAX_ROWS = 1000;
const int MAX_COLS = 1000;



(Save as Ex2.cpp) ( Send to Ex2.dat)


3.) Develop a functional decomposition and write a C++ program to print a
calandar for one year, given the year and the day of the week that January 1
falls on. It may help to think of this task as printing 12 calendars, one for
each month, given the the day of the week on which a month starts and the number
of days in the month. Each successive month starts on the day of the week that
follows the last day of the preceding month. Days of the week should be numbered
0 through 6 for Sunday through Saturday. Years that are divisible by 4 are
leap years. (Determining leap years is actually more complicated than this
but for this program it will suffice.) Here is a sample run for an interactive
program:

What year do you want a calendar for? 2002
What day of the week does january 1 fall on?
(Enter 0 for Sunday, 1 for Monday, etc..)
2

2002


January

S M T W R F S
--------------------------
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31


Febuary

S M T W R F S
--------------------------
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28


...


December

S M T W R F S
--------------------------
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31



(Save as Ex3.cpp) ( Send to Ex3.dat)
Topic archived. No new replies allowed.