195k views
0 votes
MODULES.

As stated in "Assignment Overview", each team member is required to choose and be in charge of ONE module.

Your module must involve a file with at least 6 data fields. You are encouraged to

add in more data fields in order to enhance the application's logic and practicality.

Examples of data fields are listed below. You may add a few of your own. For counting purposes, date and time will each be taken as one field (even though they

consist of 2 or more subfields)

• Staff Information Module

Staff ID, name, password, password recovery, position, etc.

E.g.: ST0001, Jennifer Ng, 1234, numbers, Administrator, ...

⚫ Member Information Module

o Member ID, name, gender, IC, contact number, up line ID, etc. o E.g.: M1001, Chong Yee Qing, F, 921213-14-1234, 011-123 4567, U101...

Sales Information Module

o Sales Order ID, item code, quantity ordered, price, member ID, etc. o E.g. 5101, V1001,30,40.00, M1001, ...

• Stock Information Module

Item Code, item description, item price, quantity in stock, minimum level,

reorder quantity, etc.

V1001, vitamin C, 25.50, 300, 50, 300,... o C2001, facial cream, 30.00,250, 50, 300,...


can anyone help me design the。 structure chart design of the module in should have planned and designed those modules required and how they flow in the structure chart​

MODULES. As stated in "Assignment Overview", each team member is required-example-1
User Jayden
by
8.7k points

1 Answer

3 votes

Answer:

here is an example of how you can write the code for the Staff Information Module in a C programming text file:
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#define MAX_STAFF 50

typedef struct {

char staff_id[10];

char name[50];

char password[20];

char password_recovery[50];

char position[20];

} Staff;

Staff staff_list[MAX_STAFF];

int num_staff = 0;

void add_staff() {

if (num_staff == MAX_STAFF) {

printf("Maximum staff limit reached.\\");

return;

}

Staff new_staff;

printf("Enter staff ID: ");

scanf("%s", new_staff.staff_id);

printf("Enter name: ");

scanf("%s", new_staff.name);

printf("Enter password: ");

scanf("%s", new_staff.password);

printf("Enter password recovery: ");

scanf("%s", new_staff.password_recovery);

printf("Enter position: ");

scanf("%s", new_staff.position);

staff_list[num_staff] = new_staff;

num_staff++;

printf("Staff added successfully.\\");

}

void view_staff() {

if (num_staff == 0) {

printf("No staff to display.\\");

return;

}

printf("Staff ID\tName\tPosition\\");

for (int i = 0; i < num_staff; i++) {

printf("%s\t%s\t%s\\", staff_list[i].staff_id, staff_list[i].name, staff_list[i].position);

}

}

int main() {

int choice;

do {

printf("\\Staff Information Module\\");

printf("1. Add Staff\\");

printf("2. View Staff\\");

printf("3. Exit\\");

printf("Enter your choice: ");

scanf("%d", &choice);

switch (choice) {

case 1:

add_staff();

break;

case 2:

view_staff();

break;

case 3:

printf("Exiting Staff Information Module.\\");

break;

default:

printf("Invalid choice.\\");

}

} while (choice != 3);

return 0;

}

You can save this code in a text file with the extension ".c" and then compile and run it using a C compiler.

MODULES. As stated in "Assignment Overview", each team member is required-example-1
User YotKay
by
7.7k points