Write a C++ Program and Subsequent Pseudo Code to print the student details applied for VITEE Examinations. Define a Class STUDENT, with required Private Data members to store the information about a student. Now define atlease one nonmember function as a friend to a class STUDENT either to read or print the student details.Input : Student_No, Student_Name, Student_Age, Student_Sex, Student_Plus12Marks, Student_Address, Student_MobleNo.Output : Student_No, Student_Name, Student_Age, Student_Sex, Student_Plus12Marks, Student_Address, Student_MobleNo, Eligible/Not EligibleNote : Student_Name Contains F_Name, M_Name, L_Name; and if Student_Plus12Makrs is > 800 then Print "Eligible" otherwise print "Not Eligible"
Question
Write a C++ Program and Subsequent Pseudo Code to print the student details applied for VITEE Examinations. Define a Class STUDENT, with required Private Data members to store the information about a student. Now define atlease one nonmember function as a friend to a class STUDENT either to read or print the student details.Input : Student_No, Student_Name, Student_Age, Student_Sex, Student_Plus12Marks, Student_Address, Student_MobleNo.Output : Student_No, Student_Name, Student_Age, Student_Sex, Student_Plus12Marks, Student_Address, Student_MobleNo, Eligible/Not EligibleNote : Student_Name Contains F_Name, M_Name, L_Name; and if Student_Plus12Makrs is > 800 then Print "Eligible" otherwise print "Not Eligible"
Solution
Sure, here is the C++ program and the subsequent pseudo code:
C++ Program:
#include<iostream>
#include<string>
using namespace std;
class STUDENT {
private:
int Student_No;
string F_Name, M_Name, L_Name;
int Student_Age;
char Student_Sex;
int Student_Plus12Marks;
string Student_Address;
long long Student_MobleNo;
public:
friend void printDetails(STUDENT);
void readDetails() {
cout << "Enter Student No: ";
cin >> Student_No;
cout << "Enter First Name: ";
cin >> F_Name;
cout << "Enter Middle Name: ";
cin >> M_Name;
cout << "Enter Last Name: ";
cin >> L_Name;
cout << "Enter Age: ";
cin >> Student_Age;
cout << "Enter Sex: ";
cin >> Student_Sex;
cout << "Enter 12th Marks: ";
cin >> Student_Plus12Marks;
cout << "Enter Address: ";
cin >> Student_Address;
cout << "Enter Mobile No: ";
cin >> Student_MobleNo;
}
};
void printDetails(STUDENT s) {
cout << "Student No: " << s.Student_No << endl;
cout << "Name: " << s.F_Name << " " << s.M_Name << " " << s.L_Name << endl;
cout << "Age: " << s.Student_Age << endl;
cout << "Sex: " << s.Student_Sex << endl;
cout << "12th Marks: " << s.Student_Plus12Marks << endl;
cout << "Address: " << s.Student_Address << endl;
cout << "Mobile No: " << s.Student_MobleNo << endl;
if(s.Student_Plus12Marks > 800)
cout << "Eligible" << endl;
else
cout << "Not Eligible" << endl;
}
int main() {
STUDENT s;
s.readDetails();
printDetails(s);
return 0;
}
Pseudo Code:
- Define a class STUDENT with private data members: Student_No, F_Name, M_Name, L_Name, Student_Age, Student_Sex, Student_Plus12Marks, Student_Address, Student_MobleNo.
- Define a public method readDetails() to read the student details.
- Define a friend function printDetails() to print the student details.
- In the main function, create an object of the class STUDENT.
- Call the readDetails() method to read the student details.
- Call the printDetails() function to print the student details.
- If Student_Plus12Marks > 800, print "Eligible". Else, print "Not Eligible".
Similar Questions
Single File Programming QuestionProblem StatementA school administrator needs to display the information of a student. The student has an ID (an integer) of 15, an age (an integer) of 23 and achieved a grade (a character) 'B'. Write a C program to print these details using appropriate data types and formatting.Input format :No console input.Output format :The output displays the values in the below format:Student id: 15Student age: 23Student grade: BRefer to the sample output for the formatting specification
You are developing a Student Record Management System in C. The system needs to store and manage information for multiple students, including their names, roll numbers, and marks obtained in different subjects. Implement array in structures to read, write, and compute average marks and the students scoring above and below the average marks for a class of N students. INPUT/OUTPUT EXAMPLE: Enter the number of students: 3 Enter details for 3 students: Student 1: Name: A Roll Number: 1 Marks in 5 subjects: Subject 1: 12 Subject 2: 13 Subject 3: 14 Subject 4: 15 Subject 5: 16 Student 2: Name: BB Roll Number: 2 Marks in 5 subjects: Subject 1: 11 Subject 2: 13 Subject 3: 12 Subject 4: 15 Subject 5: 14 Student 3: Name: CC Roll Number: 10 Marks in 5 subjects: Subject 1: 13 Subject 2: 14 Subject 3: 16 Subject 4: 17 Subject 5: 11 Class average marks: 13.73 Students scoring above average: A (Roll Number: 1) CC (Roll Number: 10) Students scoring below average: BB (Roll Number: 2)
Constructor and static memberEnter the student details using constructors with arguments and constructors without arguments. Then find the total marks of each student. If it is greater than 500 print pass , else print fail.
You have to create a struct, named Student, representing the student's details, as mentioned above, and store the data of a student.Input FormatInput will consist of four lines.The first line will contain an integer, representing age.The second line will contain a string, consisting of lower-case Latin characters ('a'-'z'), representing the first_name of a student.The third line will contain another string, consisting of lower-case Latin characters ('a'-'z'), representing the last_name of a student.The fourth line will contain an integer, representing the standard of student.Note: The number of characters in first_name and last_name will not exceed 50.Output FormatOutput will be of a single line, consisting of age, first_name, last_name and standard, each separated by one white space.P.S.: I/O will be handled by HackerRank.Sample Input15johncarmack10Sample Output15 john carmack 10
Single File Programming QuestionProblem StatementSimba is the mayor of a town with three schools - School A, School B, and School C. He wants to determine the total number of students in the town based on the number of students in School B. Note:The number of students in School A is three times the number of students in School B.The number of students in School C is 120 more than the combined number of students in School A and School B.Create a program using pointers to help Simba that takes the number of students in School B as input and calculates the total number of students in each school and overall students in the town. Input format :The input consists of an integer value N, representing the number of students in school B.Output format :The first line of output prints "Total Students in School A: ", followed by the total number of students in School A.The second line prints "Total Students in School B: ", followed by the total number of students in School B.The third line prints "Total Students in School C: " followed by the total number of students in School C.The fourth line prints "Overall Student Count: " followed by the total number of students in all three schools.Refer to the sample output for formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:20 ≤ N ≤ 250Sample test cases :Input 1 :128Output 1 :Total Students in School A: 384Total Students in School B: 128Total Students in School C: 632Overall Student Count: 1144Input 2 :235Output 2 :Total Students in School A: 705Total Students in School B: 235Total Students in School C: 1060Overall Student Count: 2000Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.Marks : 10Negative Marks : 0WhitelistSet 1:*
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.