1. Analyze and debug the following program then display the output.
A.
#include <iostream>
using namespace std:
int main() {
int i = 0;
While (i < 5) {
cout << i << "\n";
i++;
}
return 0;
}
B.
#include <iostream>
using namespace std;
int main() {
int day = 4;
switch (Day) {
case1:
cout << "Monday";
break;
case2:
cout << "Tuesday";
break:
case3:
cout << "Wednesday";
break:
case4:
cout << "Thursday";
break:
case5:
cout << "Friday";
break:
case6:
cout << "Saturday";
break:
case7:
cout << "Sunday";
break:
}
return 0;
}
Write a c++ program to declare classes namely Customer, Account, RBI (Base Class) and derived classes (SBI and ICICI) and do the following: 1. Take the value of bank name and interest rate from user. 2. Make function to calculate the homeloan rate HomeloanRate(SBI)= RBIRate+0.5 HomeloanRate(ICICI)= RBIRate+1.5 3. Display the rate based on bank name entered by user. (note:Make use of virtual function here)
Write a program that connects singly linked list with a doubly linked list
Define a class Point to represent the x, y and z coordinates of a 3D Point. Overload the == and! = operators as friend functions to compare two point objects.
4. Write a C program to check whether the given year is a Lear Year or not. If leaf year print the year in the reverse order otherwise print its sum of cube roots of digits of year.
Implement the following binary search tree operations:
1. BFS
2. DFS
3. Addition
4. Deletion
displays all the following students’ attributes
1 Student Name
2 ID
3 Gender
4 Group
5 Score
6 Grade
numbers: the positive, the zero, and the negative ones. Today, we shall pay attention only to the negative ones now. Make a loop that will accept random decimal/float numbers. When the user inputs 0, the loop will terminate and then output the sum of all negative numbers inputted in 3 decimal places.
write the programme that implementes the following algorithms? start: read the total hours the employee has woked,Total hours. Read the hourly rate of pay for the employee,Hourly rate. gross salary=total hours*hourly rate. tax=gross salary *0.1 Net salary =gross salary-tax. Display net salary
Q1. Define a class Deposit that has a principal, a rate of interest, which is fixed for all
deposits and a period in terms of years. Write member functions to
(i) alter(float) which can change the rate of interest.
(ii) interest() which computes the interest and returns it.
(iii) print() which prints data as shown below. Note that the width of each column is 20.