Question
#include #include #include #include #include program for student report card: #include #include #include using namespace std; class student { int rollno; char name[50]; int p_marks,
#include #include #include #include #include program for student report card: #include #include #include using namespace std;
class student { int rollno; char name[50]; int p_marks, c_marks, m_marks, e_marks, cs_marks; double per; char grade; void calculate(); //function to calculate grade public: void getdata(); //function to accept data from user void showdata() const; //function to show data on screen void show_tabular() const; int retrollno() const; }; //class ends here
void student::calculate() { per=(p_marks+c_marks+m_marks+e_marks+cs_marks)/5.0; if(per>=60) grade='A'; else if(per>=50) grade='B'; else if(per>=33) grade='C'; else grade='F'; }
void student::getdata() { cout>rollno; cout>p_marks; cout>c_marks; cout>m_marks; cout>e_marks; cout>cs_marks; calculate(); }
void student::showdata() const { cout
void student::show_tabular() const { cout
int student::retrollno() const { return rollno; }
void write_student(); //write the record in binary file void display_all(); //read all records from binary file void display_sp(int); //accept rollno and read record from binary file void modify_student(int); //accept rollno and update record of binary file void delete_student(int); //accept rollno and delete selected records from binary file void class_result(); //display all records in tabular format from binary file void result(); //display result menu void intro(); //display welcome screen void entry_menu(); //display entry menu on screen
int main() { char ch; cout.setf(ios::fixed|ios::showpoint); cout>ch; switch(ch) { case '1': result(); break; case '2': entry_menu(); break; case '3': break; default :cout
void write_student() { student st; ofstream outFile; outFile.open("student.dat",ios::binary|ios::app); st.getdata(); outFile.write(reinterpret_cast (&st), sizeof(student)); outFile.close(); cout
void display_all() { student st; ifstream inFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout
void display_sp(int n) { student st; ifstream inFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout
void modify_student(int n) { bool found=false; student st; fstream File; File.open("student.dat",ios::binary|ios::in|ios::out); if(!File) { cout
File.read(reinterpret_cast (&st), sizeof(student)); if(st.retrollno()==n) { st.showdata(); cout
void delete_student(int n) { student st; ifstream inFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout
void class_result() { student st; ifstream inFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout
void result() { char ch; int rno; system("cls"); cout>ch; system("cls"); switch(ch) { case '1' : class_result(); break; case '2' : cout>rno; display_sp(rno); break; case '3' : break; default: cout
void intro() { cout
void entry_menu() { char ch; int num; system("cls"); cout>ch; system("cls"); switch(ch) { case '1': write_student(); break; case '2': display_all(); break; case '3': cout>num; display_sp(num); break; case '4': cout>num; modify_student(num);break; case '5': cout>num; delete_student(num);break; case '6': break; default: cout
DO A FLOWCHART FOR THIS CODING.......
An example of FLOWCHART is given below
Part B Print the board with row=5, column=4 Print the unknown cards number with *** Print "Please insert the first card row and column separated by: Read the first card True If the cards already flipped before Print "This card already flipped. Please select another False Print "Please insert the second card row and column separated bv comma." Read the second card True If the cards already flipped before Print "This card already flipped. Please select another card." False False If the second card same as the first card Part C) True Print "You cannot select some cards twice. Please select againStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started