well my first assignment for my CS102 class has already got me really confused seeing how i never even took CS101 to begin with.
Sorry, but this needs to be written in C not C++, but im sure its so simple most of you can still help me.
so heres the problem:
Event..... Task ..... Number of Days
1 ..... ..... 15 ..... ..... 3
1 .......... 27 ..... ..... 6
1 ..... ..... 36 ..... ..... 4
2 ..... ..... 15 ..... ..... 5
3 ..... ..... 18 ..... ..... 4
4 ..... ..... 15 ..... ..... 2
4 ..... ..... 26 ..... ..... 7
4 .......... 27 ..... ..... 7
5 ..... ..... 16 ..... ..... 4
Write a program to read the critical path info and print a timetable that lists each EVENT NUMBER, THE MAX NUMBER OF DAYS FOR A TASK WITHIN THE EVENT, and THE TOTAL NUMBER OF DAYS FOR THE PROJECT COMPLETION.
this is what i figure the output.txt should look like:
Project completion timetable
------------------------------------------------
Event ..... Num of tasks ..... Max num.of days
1 .......... 3 ..... .......... 6
2 .......... 1 ..... ..........5
3 ..... ..... 2 ............... 4
4 ..... ..... 3 ..... .......... 7
5 ..... ..... 1 ..... .......... 4
------------------------------------------------
Total number of days to finish the project: 26 days
------------------------------------------------
Maximum number of tasks is 3
Events 1, 4, have 3 tasks.
------------------------------------------------
and heres what i got so far (not much):
#include <stdio.h>
int main(void)
{
/* Declare variables. */
int event, task, days;
/* Get user input from the keyboard.*/
printf("Enter event number.\n");
scanf(%i,&event);
printf("Enter task number.\n");
scanf(%i,&task);
printf(Enter number of days.\n");
scanf(%i,&days);
now im just wondering should i use a loop or something to get all the input data since there is alot of data to input, and this is supposed to work for all different types of tables as well.
This is my first C program ever!, besides hello, world! so please be gentle.
Thanks, this is such a long post that i'd really appreciate it if anyone actually reads thru the entire thing.