An introductory PowerPoint to understanding and applying the C++ programming language. Broken down into lessons covering:
Introduction: Definitions and the History of Programming
Lesson 1: Libraries, Variables and Types, Blocks and Namespaces, Functions
Lesson 2: If...Else Statements, For and While Loops, Scope
Exercise: Program a Gumball Game
Lesson 3: Classes and Objects, Pointers
Download this Presentation for free from www.ecti.co.in/downloads.html
No SIGN UP REQUIRED.
C++ Programming Training PPTs / PDFs for free.
Download free C++ Programming study material. Learn C++ Programming for free in 2 hours.
An introductory PowerPoint to understanding and applying the C++ programming language. Broken down into lessons covering:
Introduction: Definitions and the History of Programming
Lesson 1: Libraries, Variables and Types, Blocks and Namespaces, Functions
Lesson 2: If...Else Statements, For and While Loops, Scope
Exercise: Program a Gumball Game
Lesson 3: Classes and Objects, Pointers
Download this Presentation for free from www.ecti.co.in/downloads.html
No SIGN UP REQUIRED.
C++ Programming Training PPTs / PDFs for free.
Download free C++ Programming study material. Learn C++ Programming for free in 2 hours.
in this presentation i will explain you about Statements & block, If Else, ElseI f, Switch, While Loop, For loop, Do while loop, Break & continue in c++
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
1. What is function overloading? Write a c++ program to implement a function overloading.
Answer
More than one user defined functions can have same name and perform different operations this feature of
c++ is known as function overloading. Every overloaded function should however have a different prototype.
To find area of square, rectangle and circle
#include< iostream.h>
#include< conio.h>
int area(int);
int area(int,int);
float area(float);
void main()
{
clrscr();
cout< < " Area Of Square: "< < area(4);
cout< < " Area Of Rectangle: "< < area(4,4);
cout< < " Area Of Circle: "< < area(3.2);
getch();
}
int area(int a)
{
return (a*a);
}
int area(int a,int b)
{
return(a*b);
}
float area(float r)
{
return(3.14 * r * r);
}
2. Explain about the constructors and Destructors with suitable example
Answer
Constructors and Destructors:
Constructors are member functions of a class which have a same name as a class name. Constructors are
called automatically whenever an object class is created. Whereas destructors are also the member functions
with the same name as class, they are invoked automatically whenever object life expires , therefore it is
used to return memory back to the system if the memory was dynamically allocated. Generally the
destructor function is needed only when constructor has allocated dynamic memory. Destructors are
differentiated by prefix tilde (~) from constructors.
Constructor and destructors are usually defined as public members of their class and may never possess a
return value. Constructs can be overloaded whereas destructors cannot be overloaded.
Example : constructor
class myclass
{
private: int a; int b;
public:
myclass()
{a=10;
b=10;
}
int add(void)
{return a+b;
}
};
void main(void)
{myclass a;
cout<<a.add();
}
Example Destructor
#include<iostream.h>
class myclass
{public:
~myclass()
{cout<<"destructedn";
}
};
void main(void)
{myclass obj;
cout<<"inside mainn
}
Explain about polymorphism. Explain its significance
Answer
Polymorphism means the ability to take more than one form. Defined as feature in c++ where operator or
function behaves differently depending upon what they are operating on. The behavior depends on the data
types used in the operation. Polymorphism is extensively used in implementing Inheritance.
The operator + will be adding two numbers when used with integer variables. However when used with user
defined string class, + operator may concatenate two strings. Similarly same functions with same function
name can perform different actions depending upon which object calls the function. Operator overloading is
a kind of polymorphism.
In C++, polymorphism enables the same program code calling different functions of different classes
3. Example:
In below codewWe are using a common code as following so that you can draw several of these shapes with
same code and the shape to be drawn is decided during runtime:
Shape *ptr[100]
For (int j=0;j<n;j++)
Ptr[j]->draw();
As in the above code if ptr pointing to rectangle then rectangle is drawn and if it points to circle then circle is
drawn.
What is an inheritance? Explain different types of inheritance
Answer
Inheritance allows one data type to acquire characteristics and behavior of other data types this feature of
inheritance allows easy modification of existing code and also programmer can reuse code without modifying
the original one which saves the debugging and programming time and effort. It can be defined as process of
creating a new class called derived class from the existing or base class. Thus the child class has all the
functionality of the parent class and has additional features of its own. Inheritance from a base class may be
declared as public, protected, or private.
Types of Inheritance:
Inheritance are of five types as follows
1) Single inheritance
It has only one base class and one derived class
2) Multilevel inheritance
In multilevel inheritance another class is derived from the derived class
3) Multiple Inheritance
There are two base classes and one derived class which is derived from both two base classes.
4) Hierarchical inheritance
In this there are several classes derived from a single base class.
5) Hybrid inheritance
Combination of any above mentioned inheritance types.
Write a c++ program to implement the relational operator overloading for the distance
class
Answer
#include <iostream>
using namespace std;
class Distance
{private:
int feet; // 0 to infinite
int inches; // 0 to 12
public:
// required constructors
Distance(){
feet = 0;
inches = 0;
}
Distance(int f, int i){
feet = f;
inches = i;
}
// method to display distance
void displayDistance()
{cout << "F: " << feet << " I:" << inches <<endl;
}
4. // overloaded minus (-) operator
Distance operator- ()
{feet = -feet;
inches = -inches;
return Distance(feet, inches);
}
// overloaded < operator
bool operator <(const Distance& d)
{if(feet < d.feet)
{return true;
}
if(feet == d.feet && inches < d.inches)
{return true;
}
return false;
}
};
int main()
{Distance D1(11, 10), D2(5, 11);
if( D1 < D2 )
{cout << "D1 is less than D2 " << endl;
}
else
{cout << "D2 is less than D1 " << endl;
}
return 0;
}
Create a class String which stores a string value. Overload ++ operator which converts
the characters of the string to uppercase (toupper() library function of “ctype.h” can be
used).
Answer
# include<iostream.h>
# include<ctype.h>
# include<string.h>
# include<conio.h>
class string
{ char str[25];
public:
string()
{ strcpy(str, “”);}
string(char ch[])
{ strcpy(str, ch);}
void display()
{ cout<<str;}
string operator ++()
{string temp;
int i;
for(i=0;str[i]!=’0′;i++)
temp.str[i]=toupper(str[i]);
temp.str[i]=’0′;
return temp;
}
5. };
void main()
{ clrscr();
string s1=”hello”, s2;
s2=s1++;
s2.display();
getch();
}
What is a virtual function? Explain it with an example
Answer
A virtual function is a member function that is declared within a base class and redefined by a derived class.
To create virtual function, precede the function’s declaration in the base class with the keyword virtual.
When a class containing virtual function is inherited, the derived class redefines the virtual function to suit its
own needs.
Virtual means existing in effect but not in reality. Virtual functions are primarily used in inheritance.
Class A
{
int a;
public:
A()
{
a = 1;
}
virtual void show()
{
cout <<a;
}
};
Class B: public A
{
int b;
public:
B()
{
b = 2;
}
virtual void show()
{
cout <<b;
}
};
int main()
{
A *pA;
B oB;
pA = &oB;
pA->show();
return 0;
}
Output is 2 since pA points to object of B and show() is virtual in base class A.
6. Explain different access specifiers in a class
Answer
Access specifiers control access to class members. Or access specifiers in C++ determine the scope of the
class members.
A common set of access specifiers that c++ supports are as follows:
Private:
Restricts the access to the class itself therefore none of the external function can access the private data and
member functions. Therefore if a class member is private, it can be used only by the members and friends of
class.
Public:
Public means that any code can access the member by its name. Therefore If a class member is public, it can
be used anywhere without the access restrictions.
Protected:
The protected access specifier restricts access to member functions of the same Class, or those of derived
classes.
Define a STUDENT class with USN, Name, and Marks in 3 tests of subject. Declare an array of 10 STUDENT
objects. Using appropriate functions, find the average of two better marks for each student. Print the USN,
Name and the average marks of all the student
Answer
#include<iostream.h>
#include<conio.h>
class student
{
private:
char usn[10];
float avg;
char name[30];
int test[3];
public:
void get_stud_details()
{
cout<<"Enter the USN number: ";
cin>>usn;
cout<<"Enter the name of the student: ";
cin>>name;
cout<<"Enter the marks of three test: n";
for(int i=0;i<3;i++)
{
cin>> test[i];
}
}
void net_avg()
{
int m,j,k;
avg=0;
for( j=0;j<2;j++)
{
for(int k=j+1;k<3;k++)
{
if(test[j]>test[k])
7. {
m=test[j];
test[j]=test[k];
test[k]=m;
}
}
}
avg=(test[1]+test[2])/2.0;
}
void display()
{
cout<<"|******Student details are******|"<<endl;
cout<<"Student USN:"<<usn<<endl;
cout<<"Student name:"<<name<<endl;
cout<<"The best of two from the three marks"<<endl;
for( int i=1;i<3;i++)
cout<<test[i]<<endl;
cout<<"nAverage:"<<avg<<endl;
}
};
void main()
{
int n;
student s[100];
clrscr();
cout<<"Enter the number of students:";
cin>>n;
for(int i=0;i<n;i++)
{
s[i].get_stud_details();
s[i].net_avg();
}
for(i=0;i<n;i++)
{
s[i].display();
}
getch();
}
Write a C++ program to create a template function for quick sort and demonstrate sorting of integers
Answer
#include<iostream.h>
#include<conio.h>
template<class T>
int partition( T a[],int low,int high )
{T num=a[low];
int i=low+1;
int j=high;
T temp;
while( 1 )
{while( i<high && num>a[i] )