fix minor latex issues

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2022-12-26 16:30:38 +05:30
parent ad185c994e
commit 21afaa311b
7 changed files with 64 additions and 37 deletions

View File

@@ -100,11 +100,6 @@ int main() {
}
#+end_src
#+RESULTS:
#+begin_src text
-8 -3689 4 28892
6 1227 -4 -9718
#+end_src
#+LATEX: \clearpage
* Create a class TIME with members hours, minutes, seconds. Take input, add two time objects passing objects to function and display the result. [Hint: use class object as parameter of function add()]
@@ -169,17 +164,12 @@ int main() {
}
#+end_src
#+RESULTS:
#+begin_src text
Hours: 68
Minutes: 32
Seconds: 0
#+end_src
#+LATEX: \clearpage
* Create a class Student which has data members as name, branch, roll no, age , gender, marks in five subjects. Display the name of the student and his percentage who has more than 70%.Use array of objects size 5.[Hint: also declare percentage variable and calculate it and then compare all the object of student class to find name of student with percentage > 70]
#+begin_src cpp :tangle 6.cpp :results output :exports both :wrap src text
#+ATTR_LATEX: :options frame=single,breaklines=true
#+begin_src cpp :tangle 6.cpp :results output :wrap src text
#include <iostream>
using namespace std;
@@ -216,9 +206,6 @@ void Student::input() {
cin >> this->age;
cout << "Gender (m/f): ";
cin >> this->gender;
if (this->gender != 'm' || this->gender != 'f')
exit(1);
cout << "Enter Marks for" << endl;
@@ -246,6 +233,8 @@ int main() {
for (i = 0; i < NSTUDENTS; i++)
a[i].input();
cout << "\nStudents with percentage greater than 70:\n";
for (i = 0; i < NSTUDENTS; i++)
if (a[i].getPercentage() > 70)
cout << a[i].getName() << endl;
@@ -253,3 +242,56 @@ int main() {
return 0;
}
#+end_src
#+begin_src text
Name: Amaang
Branch: InformationTechnology
Enter Enrollment number: 413
Age: 14
Gender (m/f): m
Enter Marks for
Subject 1: 99
Subject 2: 93
Subject 3: 9
Subject 4: 91
Subject 5: 3
Name: Allu
Branch: Physics
Enter Enrollment number: 444
Age: 19
Gender (m/f): f
Enter Marks for
Subject 1: 100
Subject 2: 0
Subject 3: 100
Subject 4: 0
Subject 5: 100
Name: Asli
Branch: Law
Enter Enrollment number: 33
Age: 99
Gender (m/f): m
Enter Marks for
Subject 1: 1
Subject 2: 1
Subject 3: 1
Subject 4: 1
Subject 5: 2
Name: how
Branch: Music
Enter Enrollment number: 9999
Age: 9
Gender (m/f): m
Enter Marks for
Subject 1: 12
Subject 2: 22
Subject 3: 32
Subject 4: 42
Subject 5: 52
Name: sabji
Branch: CivilEngineering
Enter Enrollment number: 91
Students with percentage greater than 70:
sabji
#+end_src