Java Program Switch or Swap Arrays

Java Program Switch or Swap Two Arrays – In this program we will swap the given arrays a and b. How This Program Will Work? First of all we will check if the length that is size of the given two arrays is equal or not. If the size of arrays is equal then we can… Read More: Java Program Switch or Swap Arrays »

Loading

Java Simple Calculator Program Using Switch

Java Simple Calculator Program Using Switch statement – We will write a simple Java calculator program. This  program will start by taking input from the user – two numbers and one operator. The operator will be from basic four operations like addition, subtraction, multiplication and division (+, – , * , / ). Source Code… Read More: Java Simple Calculator Program Using Switch »

Loading

Create New Java Class Calculation Add Subtract

Java Program – Create a new class Calculation with add() and subtract methods to add two numbers and to subtract two numbers. Write down a Java Program to Design a Calculation Class with the following features: Define two instance variables num1, num2 of type double. Define two constructors – default constructor to initialize num1 and… Read More: Create New Java Class Calculation Add Subtract »

Loading

Python Temperature Conversion Program

Task: Python Temperature Conversion Program Today, we will learn how to write Python programs to 1. Convert Fahrenheit to Celsius 2. Convert Celsius To Fahrenheit. We will use the following temperature conversion formula: Celsius To Fahrenheit and Fahrenheit to Celsius conversion formulas Python Temperature Conversion Program Celsius and Fahrenheit are the measurement units of Temperature.… Read More: Python Temperature Conversion Program »

Loading

Python Code Kilometers To Miles Conversion

Python Program Logic: Python Code Kilometers To Miles Conversion is a program to input a value in kilometers. This Python program then converts the given value of kilometers provided by the user at run time, into miles. How to convert kilometers to miles? Since we know that 1 kilometer is equal to 0.621371 miles: Hence… Read More: Python Code Kilometers To Miles Conversion »

Loading

Python Program Quadratic Equation Roots

Task: Python Program Quadratic Equation Roots, Solution of Quadratic equation, Find roots of quadratic equation. How This Program Works This program uses cmath module and sqrt() builtin function to find the roots of the given quadratic equation when the coefficients a,b and c are given. The popular quadratic equation formula for solving it is as… Read More: Python Program Quadratic Equation Roots »

Loading

Python Convert Decimal to Binary Octal Hexadecimal

Task: Python Convert Decimal to Binary Octal Hexadecimal How this Program Works? This Python program will perform number convertion using builtin Python functions. It uses builtin Python functions for number system conversion: bin(int_number) oct(int_number) hex(int_number) Python bin() Function The Python bin() function converts an integer number to a binary string prefixed with 0b . For… Read More: Python Convert Decimal to Binary Octal Hexadecimal »

Loading

Python Simple Calculator Program

Python Simple Calculator Program demonstrates a four function basic calculator. This Python program provides the functionalities of:  Addition  Subtraction  Multiplication and  Division of two numbers. Code for Simple Calculator Program # This is a simple Python program # to design a simple 4 function # calculator using if -elif- else # define functions def add(x,… Read More: Python Simple Calculator Program »

Loading