Describe the working procedure of 8255A with your own words.
Implement a Class Template Queue data structure for queue operations such as Full() and Empty() with exception handling. Note: Use templates with exception handling and size of queue is set to 5.
Print: "An queue overflow exception occurred!" or "An queue empty exception
Design a program to read three integer numbers x, y and z and Evaluate arithmetic division for R, given R = z / (x - y). Use exception handling to throw an exception in case division by zero is attempted
The list of random numbers stored in an integer and float array. Perform search operation to find the search number is present or not from an array using templates concept.
* Print - Element Found or Element Not Found
a. Output "GREATER" if a given integer <num> is greater than 90.
Comment this code line by line
include <iostream>
#include <fstream>
#include <string>
using namespace std;
class Student
{
public:
Student(string fileName);
Student();
string GetName() { return name; }
string GetRoll() { return roll; }
int GetGPA() { return GPA; }
double GetCreditHours() { return creditHours; }
private:
string name;
string roll;
int GPA;
double creditHours;
};
Student::Student()
{
cout << "Enter name: ";
cin >> name;
cout << "Enter roll: ";
cin >> roll;
cout << "Enter GPA: ";
cin >> GPA;
cout << "Enter credit hours: ";
cin >> creditHours;
}
Student::Student(string fileName)
{
fstream fin;
fin.open(fileName);
if (!fin)
{
cout << "File not found!" << endl;
return;
}
fin >> name >> roll >> GPA >> creditHours;
}Comment this code line by line
include <iostream>
#include <string>
using namespace std;
class Bitkaar{
private:
int number;
public:
Bitkaar( ){ }
Bitkaar(int n){
number = n;
}
void display(){
int binN[10], i, n;
n = number;
cout<<"Decimal: " <<number << endl;
for(i=0; n>0; i++) {
binN[i]=n%2;
n= n/2;
}
cout<<"Binary: ";
for(i=i-1 ;i>=0 ;i--) {
cout<<binN[i];
}
cout<<endl;
n=number;
int rem;
string s = "";
{
rem = n % 16; // Get the remainder.
if (rem > 9)
{
switch (rem)
{
case 10: s = "A" + s; break;
case 11: s = "B" + s; break;
case 12: s = "C" + s; break;
case 13: s = "D" + s; break;
case 14: s = "E" + s; break;
case 15: s = "F" + s; break;
}
}
else
{
s = char(rem + 48) + s;
}
n = n/16;
}
if (s == "")
cout << "0";
else
cout << s;
cout<< endl;
}
~Bitkaar(){
}
};
int main(){
Bitkaar n01(7801);
n01.display();
cout<< endl;
Bitkaar n02(10);
n02.display();
return 0;
}Write Java statements that output Democrat if the party affiliation code is 'D', Republican if the party affiliation code is 'R; and independent otherwise.
Write a functionthat takes unsorted list as a parameter and return a sorted listin decending order(Do notuse any built-in function)
Find Maximum of two integers, two float and two characters using function template
Runtime Input :
4.2
2.4
4.2
5
8
5
8
Z
A
Z
A