The document outlines an assignment consisting of 12 programming tasks focused on various C++ concepts such as functions, macros, pointers, and arrays. Each task presents a specific scenario, including employee salary management, product discount calculation, and voting eligibility check, requiring the implementation of different programming techniques. The submission guidelines specify the need for source code, testing, and a deadline of December 27, 2024.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
2 views
Assignment 3
The document outlines an assignment consisting of 12 programming tasks focused on various C++ concepts such as functions, macros, pointers, and arrays. Each task presents a specific scenario, including employee salary management, product discount calculation, and voting eligibility check, requiring the implementation of different programming techniques. The submission guidelines specify the need for source code, testing, and a deadline of December 27, 2024.
Scenario: Write a program to calculate the grades of students using
function overloading:
1. Calculate grade based on total marks.
2. Calculate grade based on subject-wise marks.
3. Calculate grade based on attendance and performance ratings.
6. Voting Eligibility Check (Global and Local Variables)
Scenario: Create a program to verify voter eligibility.
Use a global variable for the minimum voting age.
Use local variables for voter age and citizenship.
Include a function that checks and displays eligibility based on these
variables.
7. Dynamic Memory Allocation for Exam Marks (Pointers)
Scenario: Input marks for n subjects using pointers.
Calculate the highest, lowest, and average marks.
Demonstrate pointer arithmetic to access marks dynamically.
Use a function to perform each operation.
8. Matrix Diagonal Sum (2-D Arrays with Pointers)
Scenario: Create a function to calculate the sum of diagonals of a square
matrix.
Input a dynamic 2-D matrix using pointers.
Return the sum of the primary and secondary diagonals.
9. Vehicle Mileage Tracker (Static Local Variables)
Scenario: Create a mileage tracker for vehicles:
Use a function to input daily mileage for a vehicle.
Use a static local variable to keep track of total mileage.
Display cumulative mileage for 7 days.
10. Temperature Monitoring System (Pointer to Arrays)
Scenario: Develop a program to monitor daily temperatures of a city:
Use a pointer to an array to input temperatures for a week.
Use functions to calculate and display the average, highest, and
lowest temperatures.
11. Teacher Attendance Record (Array of Pointers)
Scenario: A university records attendance for n teachers.
Use an array of pointers to store teacher names dynamically.
For each teacher, input and display their attendance
(present/absent).
Use a function to display attendance percentage.
12. Power Plant Efficiency Monitoring (Macros vs Functions)
Scenario: Compare efficiency calculation using:
1. A macro for quick efficiency calculation.
2. A function to calculate efficiency with input validation.
Input power generated and power consumed.
Compare the results for multiple readings.
Submission Guidelines:
Submit the C++ source code for each task.
Ensure that the program compiles and runs without errors. For each program, test it with multiple inputs and write down the expected outcome. Handwritten Assignment snapshoots as pdf on Slate. Deadline: 27th December 2024.