Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This needs to be done in C language... Here is the example code format that needs to be followed: include /* creating a student structure

This needs to be done in C language... Here is the example code format that needs to be followed:

include

/* creating a student structure */

struct student{

int id;

char fName[20];

char lName[20];

float marks;

};

/* General Declaration: returnType functionName(dataType paramName, ...);*/

struct student setStudent(void);

void

getStudent(struct student st1);

int main(void){

/* array of struct student*/

/*struct student stArray[];*/

struct student stArray[2];

int i;

for (i=0;i

printf("Enter information for student# %d

\

n", i+1);

stArray[i] = setStudent();

}

for (i = 0; i

printf("

\

nStudent #%d Detail:

\

n", (i+1));

getStudent(stArray[i]);

}

return 0;

}

struct student setStudent(void) {

struct student stTemp;

printf("Enter ID: ");

scanf("%d", &stTemp.id);

printf("Enter First

Name: ");

scanf("%s", stTemp.fName);

printf("Enter Last Name: ");

scanf("%s", stTemp.lName);

printf("Enter Marks: ");

scanf("%f", &stTemp.marks);

return stTemp;

}

void getStudent(struct student stTemp) {

printf("ID: %d

\

n", stTemp.id)

;

printf("Last name: %s

\

n", stTemp.lName);

printf("First name: %s

\

n", stTemp.fName);

printf("Marks: %.2f

\

n", stTemp.marks);

SAMPLE OUTPUT: Enter information for student# 1 Enter studentID: 12345678 Enter firstName: f1 Enter lastName: l1 Enter Marks: 18.5 Enter information for student# 2 Enter studentID: 12345677 Enter firstName: f2 Enter lastName: l2 Enter Marks: 16.5 Student #1 Detail: studentID: 12345678 lastName: l1 firstName: f1 Marks: 18.50 Student #2 Detail: studentID: 12345677 lastName: l2 firstName: f2 Marks: 16.50

image text in transcribed

Programming Exercise Obiective: In this assignment, we will demonstrate what we have learned with respect to .Using 'structs', arrays of struct and switch-case . Using multiple .c source files and header file . Input validation and proper error message .Using makefile Statement of the problem: . We'll build a small Student Course program where each student is allowed take only one course and student.courseMarks represents the marks from that course Represent each student by o StudentlD (8 digit UNIQUE ID, no leading 0) o lastName o firstName o courseMarks .Represent each Course by o courselD o course Title o courseTotal When your program will display menu to accommodate the following choices (you may have 15-20 choices depending on how you design) 1. 2. 3. 4. 5. 6. 7. Enter the details of a student Enter the details of a course Register a student to a course (at most one course) Modify registration of a student Edit a student record Edit a course record Display student record by: a. studentlD or b. last name or c. first name or d. registered course ID or print all students f. e. or students without registration to course 8. Display course record by: a. course ID or b. student ID or c. course total or d. course without students Q. To quit Programming Exercise Obiective: In this assignment, we will demonstrate what we have learned with respect to .Using 'structs', arrays of struct and switch-case . Using multiple .c source files and header file . Input validation and proper error message .Using makefile Statement of the problem: . We'll build a small Student Course program where each student is allowed take only one course and student.courseMarks represents the marks from that course Represent each student by o StudentlD (8 digit UNIQUE ID, no leading 0) o lastName o firstName o courseMarks .Represent each Course by o courselD o course Title o courseTotal When your program will display menu to accommodate the following choices (you may have 15-20 choices depending on how you design) 1. 2. 3. 4. 5. 6. 7. Enter the details of a student Enter the details of a course Register a student to a course (at most one course) Modify registration of a student Edit a student record Edit a course record Display student record by: a. studentlD or b. last name or c. first name or d. registered course ID or print all students f. e. or students without registration to course 8. Display course record by: a. course ID or b. student ID or c. course total or d. course without students Q. To quit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions