Code-Find Percentage

Duration: 11 min

This video lesson is available to enrolled students.

Return to /learn/HEXAWARE-PREPARATION/programming-basics-ccjavapython/programming-in-c/c-by-yash-sir/asset-code-find-percentage after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Quantitative Ability: Speed Mathematics and Basic Mathematics, Percentage, Ratio and Proportion (Ratios), Average, Profit and Loss, Simple Interest and Compound Interest, Time and Work, Pipe and Cistern, Speed Time and Distance, Number System, HCF LCM, Data Interpretation, Age Problems, Mixture and Alligation, Partnership, Algebra, Sequence and Series (Series), Mensuration and Geometry, Arithmetic
  2. Reasoning Ability: Puzzle Solving (Puzzles), Seating Arrangements, Coding Decoding, Blood Relations, Directions (Direction Test), Syllogisms, Data Sufficiency, Ranking, Order and Sequence, Series (Number and Letter Series) (Numerical Relations and Reasoning), Logical Sequence Of Words, Calendar, Clock, Cubes & Dices, Analytical Reasoning (Counting Figures Reasoning), Data Arrangement, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning)
  3. Verbal Ability: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Cloze Test (Cloze Passage), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Vocabulary, Sentence Completion (Fill in the blanks), Active Passive Voice (Voice), Direct and Indirect Speech, Subject Verb Agreement (Verb Noun Agreement), Tenses, Preposition, Articles, Sentence Correction (Error Correction)
  4. Programming Basics (MCQs + Interview): C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir
  5. OOPs (MCQs + Interview): Object Oriented Programming (OOPS)
  6. DBMS (MCQs + Interview): Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Transaction Management, Decomposition Properties & 4NF, Concurrency Control, Database Recovery, File Organization & Indexing, Relational Algebra, Database Security & Authorization
  7. SQL (MCQs + Interview): SQL
  8. Operating Systems (MCQs + Interview): Introduction to OS, Process Management, CPU Scheduling, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Process Synchronization, Disc Scheduling, File Management, Security
  9. Computer Networks (MCQs + Interview): 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, Network Security, Mobile Technology, Cloud Computing and IoT, Cyber and Info Security
  10. Coding: Coding Questions by Yash Sir
  11. HR Interview: MR & HR Interview Preparation
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

  1. 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. 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.

  3. 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.

  4. 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.

Loading lesson…