Comment this code line by line in simple english
Comment each line and said why we use.
#include <iostream>
#include <cmath>
using namespace std;
float distance(int x1, int y1, int x2, int y2)
{
return sqrt(pow(x2 - x1, 2) +
pow(y2 - y1, 2) * 1.0);
}
int main()
{
cout << "DISTANCE IS:"<< distance(3, 4, 4, 3);
return 0;
}
Write a program make a class barabitkaar.Given two arrays A[n] & B[n] containing bit strings representing sets A & B respectively, write a code fragment to construct bit string representing the set 𝐴 − 𝐵.
Make a class named Fruit and Vegetables with a data member to calculate the number of fruits and Vegetables in a basket. Create four other class named Apples, Mangoes , carrot and Potato to calculate the number of Fruits and Vegetables in the basket. Print the number of fruits and Vegetables of each type and the total number of fruits in the basket.
How to Write a c program using string functions that accepts a coded value of an item and display its equivalent tag price? Can someone enlighten me how you guys did it??
The base of the key is:
0 1 2 3 4 5 6 7 8 9
X C O M P U T E R S
Sample input/output dialogue:
Enter coded value: TR.XX
Tag price: 68.00
Note: the numbers below are the corresponding equivalent values of the letters.
Comment this code line by line in simple english
Comment each line
include <iostream>
#include <cmath>
using namespace std;
main(void)
{
float x1=2,y1=3,x2=6,y2=9;
float Dist;
Dist = sqrt(pow(x1-x2,2) + pow(y1-y2,2));
cout<<"\nPoint-1: ("<<x1<<", "<<y1<<")";
cout<<"\nPoint-2: ("<<x2<<", "<<y2<<")";
cout<<"\n\nDistance between the points: "<<Dist;
return(0);
}
1. Make a VB program to compute the net salary of an employee. The user inputs the basic salary. And the net salary is shown in a label. Compute the net salary according to the following formulas:
· net salary = basic salary - tax
· if basic salary >= 2000, tax = basic salary * 0.04
· if basic salary < 2000, tax = basic salary * 0.02
Write a program to convert Fahrenheit to Celsius degrees by passing pointers
as arguments to the function?
(Take value from the user at runtime)
Find Maximum of two intergers, two float and two characters using fuction template
Given three arrays A[n], B[n] & C[n] containing bit strings representing sets A, B & C respectively, write a code fragment to determine whether (̅∩ ) ⊂ ̅
Console Application for library system
Objective: Design and implement an application in C++ to maintain inventory of a library
using object oriented paradigm.
Define class for library considering the followings:
a. Enlist data members and methods with access specifies.
b. Enlist constant and static members of the class.
c. Specify interface of the class with user.
d. Specify constructors and destructor.
e. Methods for shallow and deep copy constructor.