I am totally lost and don't know where to begin with this lab assignment. please help me guys.
i am suppose to output this
Wish to see another student (y or Y to proceed): y
Student key: 88
Student name: Robert Tan
Modules Marks Grades
math 75 Pass
--------------------------------------…
Wish to see another student (y or Y to proceed): y
Enter a student key:87
Student not found
--------------------------------------…
Wish to see another student (y or Y to proceed): n
the student key will be taken from a notepad file with all the student's info.
class Marks{
String name //example math
String mark // 75
String overall // Pass
class student{
integer student_key
String student_name
array<Marks> // Or maybe just a String depends of the file
}
BOOL readFile();
BOOL Show_Students(int key);
Main
readFile()
loop
print: wish to see another student(input)
if (y or Y){
print: enter student key: key
Show_student (key)
}
exit when input == n Or == N
There you go.. you can start developing from this. Now you have an idea about what you have to do.
I guess I would need more information on your problem. Do you have to create the file first, or is the file created for you? If it was created for you, then you should have the record layout of the file, which I could code to match it. It would also supply me all the math I would need to scan up and down the file, using binary procedures. What I read you have is a standard text file, which I would handle differently.
yes i am supposed to create my own text file. it is just a simple typing of data unto the notepad and the program will be reading the data from the notepad.
//The mark class will be used in an array inside students in order to store the
//name, mark and overall values. in case we have a student
//with some marks for different modules
class Marks{
String name //example math
String mark // 75
String overall // Pass
}
//student class will store an array of Marks, the name of the student and its key.
class student{
integer student_key // 001
String student_name // damien
array<Marks> listModules // list of modules with their marks
}
//You need to read the file where you have all the info and store it at a student array.
BOOL readFile(array<student> listStudents);
// You need a function to show the students stored in your array<Students>.
//Int key. needed for printing the student that has the key inputed
BOOL Show_Students(int key);
//Main program.
Main
array<students> listStudents;
//Calls readFile
readFile(&listStudents)
//While user wants to show a student (Y) come back again here.
loop
print: wish to see another student(input)
if (y or Y){
print: enter student key: key
Show_student (key)
}
exit when input == n Or input== N
//Program exists when input = n Or input = N