CP Lesson1-2 Excerise and Tasks
CP Lesson1-2 Excerise and Tasks
#include <string>
int main() {
int age;
string fullName;
string department;
double cgpa;
cout << "Speed of light: " << speedOfLight << " m/s" << endl;
cout << "Planck's constant: " << plancksConstant << " J.s" << endl;
cout << "Charge on electron: " << electronCharge << " C" << endl;
cout << "Avogadro's number: " << avogadrosNumber << " /mol" << endl;
return 0; }
Lesson2 Task1:
#include <iostream>
#include <cmath>
int main() {
double angleInDegrees;
cout << "cos(" << angleInDegrees << ") = " << cosine << endl;
cout << "sin(" << angleInDegrees << ") = " << sine << endl;
cout << "tan(" << angleInDegrees << ") = " << tangent << endl;
return 0;
}
Lesson 2 Task2
#include <iostream>
#include <cmath>
int main() {
double num;
//Assignment or Formulation
//Outputs
cout << "Cube: " << cube << endl; cout << "Square root: " << squareRoot << endl;
cout << "Floor: " << floorValue << endl; cout << "Truncate: " << truncateValue << endl;
return 0;
}
Lesson2 E1(EXPRESSIONS):
#include <iostream>
#include <cmath>
int main() {
double x, y;
cin >> x;
cin >> y;
return 0;