Code-Find Percentage
Duration: 11 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- Section A | English: Vocabulary, Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Preposition, Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Articles, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Verbal Analogy (Word Based Analogy)
- Section A | Quant Aptitude: Ratio and Proportion (Ratios), Mixture and Alligation, Permutation and Combination, Number System, HCF LCM, Sequence and Series (Series), Speed Time and Distance, Arithmetic, Algebra, Powers and Exponents (Surds and Indices), Average, Age Problems, Percentage, Profit and Loss, Partnership, Time and Work, Simple Interest and Compound Interest, Mensuration and Geometry, Probability, Pipe and Cistern
- Section A | Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Calendar, Clock, Blood Relations, Directions (Direction Test), Seating Arrangements, Ranking, Order and Sequence, Puzzle Solving (Puzzles)
- Section B | C Programming: C Programming by Yash Sir, Coding Questions by Yash Sir
- Section B | Data Structures: Algorithm Analysis, Greedy Algorithms, Time Complexity Analysis, Sorting Algorithms, Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs
- Section B | OOP (C++): Object Oriented Programming (OOPS), Programming in C++
- Section B | OS: Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Threads & Process Creation, Deadlock, Memory Management, Virtual Memory, Disc Scheduling, File Management, Windows OS
- Section B | Networking: Introduction to CN, Data Communication, DLL: Access Control, DLL: Flow Control, DLL: Error Control, DLL: Framing, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware basics
- Section B | AI & Big Data Basics: AI & ML by Arun Sir, Big Data Systems
- Section C | Digital Electronics: Digital Systems & Boolean Basics, Logic Gates & Hardware, Boolean Expression, Boolean Minimization, Combinational Circuit, Sequential Circuits, Number System, Number Representation, Analog-Digital Conversion
- Section A, C | Comp. Fundamentals, COA: Basics of COA, Floating Point Rep, Cache Memory Organization, Input Output Organisation, Pipelining, Instr Formats & Modes, Control Unit Design, Register Transfer and Microoperations, Multiprocessors, Programming the Basic Computer
- MOCK TEST:
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This video is a C++ programming tutorial that teaches how to calculate the percentage of marks for five subjects. The instructor begins by presenting a C++ code snippet in an online IDE, which calculates the percentage using hardcoded marks for Physics (89), Chemistry (86), Maths (82), English (78), and Computer Science (97). The code uses integer variables and a formula to compute the percentage. The instructor then transitions to a whiteboard to explain the mathematical formula for percentage: (obtained marks / total marks) * 100, and demonstrates that the total marks for five subjects, each out of 100, is 500. The lesson progresses by showing the correct way to write the code, emphasizing that the sum of the marks should be divided by 5.0 (a float) to ensure a floating-point result, which is stored in a float variable named 'Percentage'. The instructor also demonstrates the best practice of declaring the subject variables as 'float' to avoid integer division issues. The video concludes with a demonstration of the code running in the IDE, showing the output of 86.4, and a final version of the code that includes user input prompts for the marks of each subject.
Chapters
0:00 – 2:00 00:00-02:00
The video opens with a C++ code editor displaying a program to calculate the percentage of five subjects. The code includes variables for Physics (89), Chemistry (86), Maths (82), English (78), and Computer Science (97). The instructor explains the initial code, which uses integer variables and a formula to calculate the percentage. The code is shown with a commented-out line for the percentage calculation. The instructor then transitions to a whiteboard to explain the mathematical formula for percentage: (obtained marks / total marks) * 100. The on-screen text clearly shows the formula and the total marks as 500.
2:00 – 5:00 02:00-05:00
The instructor returns to the code editor to correct the calculation. The code is updated to use a float variable 'Percentage' and the formula is corrected to (Physics + Chemistry + Maths + English + Computer_Science) / 5.0 to ensure a floating-point result. The instructor explains that dividing by 5.0 (a float) prevents integer division, which would truncate the decimal part. The code is shown with the correct calculation, and the instructor emphasizes the importance of using floating-point division. The on-screen text shows the corrected code and the instructor's explanation of the formula.
5:00 – 10:00 05:00-10:00
The instructor demonstrates the correct way to write the code, emphasizing the best practice of declaring the subject variables as 'float' to avoid any issues with integer division. The code is updated to use float variables for all subjects. The instructor then shows the final version of the code, which includes user input prompts for the marks of each subject. The code is shown with the correct calculation and the output is displayed as 86.4. The instructor explains that the code is now complete and ready to be used.
10:00 – 10:35 10:00-10:35
The video shows the final version of the C++ code, which includes user input prompts for the marks of each subject. The code is shown with the correct calculation and the output is displayed as 86.4. The instructor explains that the code is now complete and ready to be used. The on-screen text shows the final code and the instructor's explanation of the final steps.
The video provides a comprehensive tutorial on calculating a student's percentage in C++. It begins with a flawed code example that uses integer variables, leading to incorrect results due to integer division. The instructor then explains the correct mathematical formula and demonstrates the proper way to write the code using floating-point arithmetic. The key learning points are the importance of using floating-point division (by dividing by 5.0 instead of 5) and the best practice of declaring variables as 'float' to ensure accurate results. The lesson progresses from a simple hardcoded example to a more robust version that accepts user input, making the program more versatile and practical.

