Learn Computer Programming Free from our source codes in my website.
Sponsored Link Please Support
https://www.techseries.dev/a/27966/qWm8FwLb
https://www.techseries.dev/a/19181/qWm8FwLb
My Personal Website is http://www.jakerpomperada.com
Email me at jakerpomperada@gmail.com and jakerpomperada@yahoo.com
Sunday, June 30, 2024
Friday, June 28, 2024
Temperature Converter Using Encapsulation in C++
#include <iostream>
class TemperatureConverter {
private:
double celsius;
double fahrenheit;
public:
TemperatureConverter() : celsius(0.0), fahrenheit(32.0) {}
void setCelsius(double c) {
celsius = c;
fahrenheit = (celsius * 9.0/5.0) + 32.0;
}
void setFahrenheit(double f) {
fahrenheit = f;
celsius = (fahrenheit - 32.0) * 5.0/9.0;
}
double getCelsius() const {
return celsius;
}
double getFahrenheit() const {
return fahrenheit;
}
};
int main() {
TemperatureConverter converter;
std::cout << "\n\tTemperature Converter Using Encapsulation in C++\n\n";
// Convert from Celsius to Fahrenheit
converter.setCelsius(35.0);
std::cout << "\t35 degrees Celsius is equal to " << converter.getFahrenheit() << " degrees Fahrenheit.\n";
// Convert from Fahrenheit to Celsius
converter.setFahrenheit(112.3);
std::cout << "\n\tEnd of Program\n\n";
return 0;
}
Thursday, June 27, 2024
Area of the Circle Using OOP Approach
#include <iostream>
#include <iomanip>
class Circle {
public:
// Constructor to initialize the radius
Circle(double radius) {
this->radius = radius;
}
// Method to calculate the area of the circle
double calculateArea() {
return 3.14159265359 * radius * radius; // Assuming Pi to be approximately 3.14159265359
}
// Method to calculate the circumference of the circle
double calculateCircumference() {
return 2.0 * 3.14159265359 * radius; // Assuming Pi to be approximately 3.14159265359
}
private:
double radius;
};
int main() {
double radius;
// Input the radius of the circle
std::cout << "\n\tArea of the Circle Using OOP Approach\n";
std::cout << "\n\tEnter the radius of the circle: ";
std::cin >> radius;
// Create a Circle object with the provided radius
Circle circle(radius);
// Calculate and display the area and circumference
double area = circle.calculateArea();
double circumference = circle.calculateCircumference();
std::cout << "\n\tThe Area of the circle: " <<std::fixed <<std::setprecision(2) << area << std::endl;
std::cout << "\tThe Circumference of the circle: " <<std::fixed <<std::setprecision(2) << circumference << std::endl;
std::cout << "\n\n\tEnd of Program. Thank you for using this program." << std::endl;
return 0;
}
Wednesday, June 26, 2024
Tuesday, June 25, 2024
Monday, June 24, 2024
What is a Data Center?
What is a Data Center?
Data centers are physical facilities that enterprises use to house business-critical applications and information and which are evolving from centralized, on-premises facilities to edge deployments and public-cloud services.
What is Oracle Application Express?
What is Oracle Application Express?
Oracle APEX (also known as APEX) is an enterprise low-code application development platform from Oracle Corporation. APEX is used for developing and deploying cloud, mobile and desktop applications.
What is Oracle Database?
What is Oracle Database?
An Oracle Database (aka Oracle RDBMS) is a collection of data organized by type with relationships being maintained between the different types. The primary purpose of a database is to store and retrieve related information.
