Dinthill Technical High School

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 28

DINTHILL TECHNICAL HIGH SCHOOL

Computer Science-IA

Name: Azania Francis

Centre number:-

Territory: Jamaica

Teacher: Mr. Campbell


Table Of Contents
Acknowledgment………………………………………………………1

Problem Definition……………………………………………………..2-3

Narrative………………………………………………………………..4

Algorithm……....………………………………………………………5

Code….…………………………………………………………………

Test Plan………………………………………………………………….

Print Screens……………………………………………………………..

Structure Chart……………………………………………………………..
Acknowledgment

First and foremost I would like to thank God for without him nothing is

possible.I would also like to express my sincerest  gratitude to my

teacher, Mr.Campbell who has devoted his time and energy in helping me

with this Internal Assessment. Lastly I would like to thank my parents

who have supplied me with the tools to do this assessment.


Problem Definition
The Dinthill Technical High School is a high school located in rural

St.Catherine.The institution was founded in 1938, first as a practical

training centre for youths then later in the mid-fifties became a rural

secondary technical school.The school has approximately 1,400 students

and they provide a large technical- based academic programme. The staff

currently utilizes a manual system to register students for the new school

year. In this system, the staff utilizes alot of paper as they issue countless

amounts of registration forms to parents so that they can register their

child/children for the new school year.

Parents as well as staff members find the current registration system

rather tedious and time consuming as they have to manually fill in these

forms by hand each year. Calculating the student’s tuition for the new

school year is also difficult when the parents are unable to pay the full

school tuition at once and require special payment options.The hand-

filled forms are sometimes illegible which causes the student to be

registered with wrong information because the forms were filled out

with poor hand writing.


A program should be created that stores the necessary registration

information for the students, their class, and their tuition to be paid.Each

parent should have access to a form where they can fill out and are

automatically notified if their child/children are sucessfully enrolled for

the new school year and the tuition to be paid for that school year. The

parent should have the ability to input the name of the student,their age,

gender and their grade. This information should be stored in a file.

The program should then be able to output a general statement stating

whether or not the student has been accepted for the next school year.The

program should also output the tuition fee for that school year and further

payment options available for parents who are unable to pay the full

tuition fee at once.


Narrative
The Registration System was designed to improve the situation of the

school.The Registration System should provide these simple operations;

the user should first select whether they are registering for the lower

school,which consists of grades 7-11 or the upper school, which consists

of grades 12 and 13.After selecting the appropriate option for them the

user will be then required to fill out a form. Upon completion of this form

the user would be automatically notified if she/he is successfully enrolled

for that school year and will receive a special student ID number. The

student will then need to input this unique ID number in order to access

the payment options for his/her tuition.

The user will then be required to choose from the three payment options

listed.The user has the option of paying the tuition in one full payment

and receiving a discount of ten percent; paying the tuition in two

deposited payments and receiving a five percent discount or paying the

tuition in three payments.After choosing one of the payment options the

user’s balance will be printed.


Algorithm
Start

Declare variables

grade- stores the grade/class the student is in.

age- stores the age of the student.

Tuition- stores the required amount to be paid for the child’s school fee.

phone_num- stores the phone number of the parent.

fname[30]- stores the child’s first name.

lname[30]- stores the child’s last name.

gender[30]- stores the gender of the child.

Pay_plan[30]- stores the payment plan option.

Execute welcomescreen function

write     ***********************************************

write ** Welcome to the ROSEWELL HIGH SCHOOL ! !   **

 write   **                                     ---   **

write   ** Where learning is made fun!!              ** write 

***********************************************

Execute menu function

write Welcome to our main menu

write Please choose the option below that pertains to your child
write 1) Lower School(Grades 7-11)

write 2) Upper School(Sixth form)

Declare myinput as integer

write Please type 1 for option1 and 2 for option2

write Which option will you choose?

read myinput

switch myinput

case 1:

Write ***REGISTRATION FORM FOR LOWER SCHOOL***

login

break

    case 2:

Write ***REGISTRATION FORM FOR SIXTH FORM***

login2

break;

default:

Write INVALID CHOICE:PLEASE type 1 or 2

menu

Execute login function

FILE *fptr;

student myStudents;

fptr = fopen emp.rec w


if fptr==NULL then

Write File does not exist

return;

Write Please enter the student's name:

Read myStudents.fname, myStudents.lname

Fprintf (fptr, "NAME    =%s%s\n,myStudents.fname, myStudents.lname

");

Write Please enter the student's gender:

Read myStudents.gender

Fprintf *fptr, "GENDER   myStudents.gender

Write Please enter the student's age:

Read myStudents.age

Fprintf *fptr, AGE  ,myStudents.age

Write Please enter the Grade level of the student:

Read myStudents.grade

Fprintf *fptr, GRADE   ,myStudents.grade

Write Please enter the student's phone number

Read myStudents.phone_num

Fprintf *fptr, "PHONE NUMBER  myStudents.phone_num

Write Please enter the student's email:

Read myStudents.email

Fprintf fptr, EMAIL    =myStudents.email


fclose(fptr);

    if myStudents.age>12 == myStudents.age<17

Write *** CONGRATS!! Your child/ward has been successfully

registered!!!***

Endif

else 

Write Unfortunately your child/ward cannot be accepted

char ch;

fptr=fopen("emp.rec","r"

End else

if (fptr==NULL){

Write File does not exist

exit(EXIT_FAILURE);

Write file is open

do

ch=fgetc(fptr);

putchar(ch);

} while (ch!=EOF);

fclose(fptr);
system("cls");

paymentplan();

void login2(){

FILE *fptr;

student oldStudents;

fptr = fopen("emp.rec","w");

if (fptr==NULL){

Write File does not exist

return;

End if

Write Please enter the student's name:

Read oldStudents.fname,oldStudents.lname

fprintf(fptr, "NAME    =%s%s\n,oldStudents.fname,oldStudents.lname "

Write Please enter the student's gender:

Read oldStudents.gender

fprintf(fptr, "GENDER    =%s\n,oldStudents.gender ");

Write Please enter the student's age:

Read oldStudents.age

fprintf(fptr, "AGE    =%d\n,oldStudents.age ");

Write Please enter the Grade level of the student:


Read oldStudents.grade

fprintf(fptr, "GRADE    =%d\n,oldStudents.grade ");

Write Please enter the student's phone number:

Read oldStudents.phone_num

fprintf(fptr, "PHONE NUMBER    =%d\n,&oldStudents.phone_num ");

Write Please enter the student's email:

Read oldStudents.email);

fprintf(fptr, "EMAIL    =%s\n,oldStudents.email

fclose(fptr);

if oldStudents.age>17 == oldStudents.age<20 /

Write *** CONGRATS!! Your child/ward has been successfully

registered!!!*** endif

else 

Write Unfortunately your child/ward cannot be accepted

    System cls

End else

void paymentplan(){

student myStudents;

int tuition;

switch (myStudents.grade)

{
case 7:

case 8:

case 9:

case 10:

case 11:

tuition=28000;

break;

case 12:

case 13:

tuition=40000;

break;

float disc;

float newschfee;

int myplan;

Write Please choose one of the following Payment options below

   Write 1) efull(Paying the full tuition )

Write 2) bipay(Paying   the tuition in two deposits )

  Write 3) tripay (Paying the tuition in three deposits)

   Write Please enter option below

Write Which option will you choose?

Read myplan
if myplan=1 then

disc=tuition*-0.1

newschfee=tuition-disc

Write The student's new Tuition is:,newschfee

endif

else myplan=2

disc=tuition*-0.5

newschfee=tuition-disc

Write The student's new Tuition is:, newschfee

end else

else myplan=3

newschfee=tuition

Write The student's new Tuition is: newschfee

end else

END.
Coding of Program
#include<stdio.h>

#include <stdlib.h>

#include <string.h>

// prototype

typedef struct //a structure called student is created.

int grade;

int age;

int phone_num;

char fname[30];

char gender[30];

char lname[30];

char email[30];

} student;

// function prototypes

void welcomescreen();
void menu();

void login();

void login2();

void saverecord();

void paymentplan();

int main() {

welcomescreen();

menu();

paymentplan();

return 0;

void welcomescreen(){    

printf("      

\t***********************************************\n");

printf("   \t** Welcome to the ROSEWELL HIGH SCHOOL ! !   **\n");

printf("       \t**                                     ---   **\n");

printf("       \t** Where learning is made fun!!              **\n");

printf("      

\t***********************************************\n"); 

void menu(){
printf("\n\n Welcome to our main menu\n\n");

printf("Please choose the option below that pertains to your child:\n");

printf("\n 1) Lower School(Grades 7-11)");

printf("\n 2) Upper School(Sixth form)");

int myinput;

printf("\n\n\n Please type 1 for option1 and 2 for option2\n");

printf(" Which option will you choose? ");

scanf("%d",&myinput);

system("cls");

switch (myinput)

case 1:

printf("\n\t\t***REGISTRATION FORM FOR LOWER SCHOOL***");

    login();

    break;

    case 2:

printf("\n\t\t***REGISTRATION FORM FOR SIXTH FORM***");

login2();

break;

default:

printf("INVALID CHOICE:PLEASE type 1 or 2\n");

menu();
}

void login(){

FILE *fptr;

student myStudents;

fptr = fopen("emp.rec","w");

if (fptr==NULL){

printf("File does not exist \n");

return;

printf("\n\n Please enter the student's name: ");

scanf("%s%s",myStudents.fname,myStudents.lname);

fprintf(fptr, "NAME    =%s%s\n,myStudents.fname,myStudents.lname ");

printf("\n\n Please enter the student's gender: ");

scanf("%s",myStudents.gender);

fprintf(fptr, "GENDER    =%s\n,myStudents.gender ");

printf("\n Please enter the student's age: ");

scanf("%d",&myStudents.age);

fprintf(fptr, "AGE    =%d\n,myStudents.age ");

printf("\n Please enter the Grade level of the student: ");

scanf("%s",&myStudents.grade);
fprintf(fptr, "GRADE    =%d\n,myStudents.grade ");

printf("\n Please enter the student's phone number: ");

scanf("%ld",&myStudents.phone_num);

fprintf(fptr, "PHONE NUMBER    =%d\n,myStudents.phone_num ");

printf("\n Please enter the student's email: ");

scanf("%s",&myStudents.email);

fprintf(fptr, "EMAIL    =%s\n,myStudents.email ");

fclose(fptr);

    if (myStudents.age>12 == myStudents.age<17 /*condition goes here*/)

    /* if the condition is true, the code will be executed*/

printf("\n\n*** CONGRATS!! Your child/ward has been successfully

registered!!!***\n");

} else  {

printf("Unfortunately your child/ward cannot be accepted"); }

char ch;

fptr=fopen("emp.rec","r");

if (fptr==NULL){

printf("File does not exist \n");

exit(EXIT_FAILURE);

}
printf("file is open\n\n");

do

ch=fgetc(fptr);

putchar(ch);

} while (ch!=EOF);

fclose(fptr);

system("cls");

paymentplan();

void login2(){

FILE *fptr;

student oldStudents;

fptr = fopen("emp.rec","w");

if (fptr==NULL){

printf("File does not exist \n");

return;

printf("\n\n Please enter the student's name: ");

scanf("%s%s",oldStudents.fname,oldStudents.lname);

fprintf(fptr, "NAME    =%s%s\n,oldStudents.fname,oldStudents.lname ");


printf("\n\n Please enter the student's gender: ");

scanf("%s",oldStudents.gender);

fprintf(fptr, "GENDER    =%s\n,oldStudents.gender ");

printf("\n Please enter the student's age: ");

scanf("%d",&oldStudents.age);

fprintf(fptr, "AGE    =%d\n,oldStudents.age ");

printf("\n Please enter the Grade level of the student: ");

scanf("%s",&oldStudents.grade);

fprintf(fptr, "GRADE    =%d\n,oldStudents.grade ");

printf("\n Please enter the student's phone number: ");

scanf("%d",&oldStudents.phone_num);

fprintf(fptr, "PHONE NUMBER    =%d\n,&oldStudents.phone_num ");

printf("\n Please enter the student's email: ");

scanf("%s",&oldStudents.email);

fprintf(fptr, "EMAIL    =%s\n,oldStudents.email");

fclose(fptr);

if (oldStudents.age>17 == oldStudents.age<20 /*condition goes here*/) {

    /* if the condition is true, the code will be executed*/

printf("\n\n*** CONGRATS!! Your child/ward has been successfully

registered!!!***\n");

} else  {

printf("Unfortunately your child/ward cannot be accepted"); }


    system("cls");

void paymentplan(){

student myStudents;

int tuition;

switch (myStudents.grade)

case 7:

case 8:

case 9:

case 10:

case 11:

tuition=28000;

break;

case 12:

case 13:

tuition=40000;

break;

float disc;

float newschfee;
int myplan;

printf("Please choose one of the following Payment options below \n");

    printf("1) efull(Paying the full tuition )\n\n");

printf("2) bipay(Paying   the tuition in two deposits )\n\n");

    printf("3) tripay (Paying the tuition in three deposits)\n\n");

    printf("\n\n\n Please enter option below");

printf(" Which option will you choose? ");

scanf("%d",&myplan);

if (myplan=1){

disc=tuition*-0.1;

newschfee=tuition-disc;

    printf("The student's new Tuition is:%d \n",newschfee);

else if(myplan=2){

disc=tuition*-0.5;

newschfee=tuition-disc;

printf("The student's new Tuition is: %d \n", newschfee);}

else (myplan=3); {

newschfee=tuition+2;

printf("The student's new Tuition is: %d \n", newschfee);}

}
Testing and Presentation
Variable Test Test Data Purpose of User’s Actual
Name Type Data Expected Results

Result
fname,lname string Sam morgan To allow the The program The program
program to store the data stores the data
store the and asks for the and asks for the
name of the next input student’s next
user piece of
information
grade integer 12 To allow the The program The program
program to store the data utilizes this info
store the and asks for the to establish if
grade of the next input the user will be
user accepted
age integer 18 To allow the The program The program
program to stores the data uses this data to
store the age and asks for the determine the
of the user student’s next tuition
piece of
information
Variable Test Type Test Purpose of User’s Expected Actual Results

Name Data Data Result


Tuition integer 40000 To all the program The program The actual
to output the displays the final amount to paid
value of the tuition tuition to be paid will be calculated
from the tuition
displayed
myplan integer 1 To all the user to The program The program uses
select a payment stores the data this decision to
option and asks for the calculate the final
next input tuition

You might also like