Skip to main content

Changing fahrenheit temperature in celsius , java programming language

Changing fahrenheit in celsius java programming  language.

Dear student if you practice with source so it will very simple way to learn coding .
here you will get web developing code like javascript ,html ,css,
and also java programming language .
 

Please  share this side,s link to your  friends and relative.
Please see this video tutorial on full resolutions .


how to make of this :
so friend first we need to create a class then 
we will also create his mean method in this class because it is not
very dynamic program .
then we will get a input from user for this we need to create a 
scanner class as i show in this code-source for choosing option then
we will create a swicth and  if our case 1, so for we need to create  all task for those case 
and after this break keyword because if your case match so programm will break here and not excuse all program 
again like this we need to create this all case but only we need to change this all case ,s task because in every case we need to different task and in the last we creat our default value because if any case will not match so in this case itthis program will so a default value .

how to handle exception :
for this on the frist block we need to create try keyword and  below of this block we need to use of catch keyword and small bracket in this
 bracket we create to exception name and a object and again curly bracket open and in this bracket we show his exception cause 



you can use of this source-code through copy and paste.
import java.util.InputMismatchException;
import java.util.Scanner;
// class name Animals is
class Animals{
//main method
public static void main(String args[]){
/* suppose if any person enter any
String type values on the place of integer
in this case this program will throw a
exception"InputMismatchException" so we need
to Handle of this exception with the help
of try and catch
*/try{

// first here we take a input for fahrenheit , through Scanner class
Scanner in= new Scanner(System.in);
System.out.println("Enter your temperature in fahrenheit ");
int fahrenheit = in.nextInt();

/*here we used of this formula
((fahrenheit -32)/1.8)
for changing in celsius temperature,
and here i used to float for accuracy with type-casting
*/
float changing=(float)((fahrenheit -32)/1.8);
// i printed this values
System.out.println("your temperature in celsius " +changing);





}
catch (InputMismatchException e) {
/*when will be enter wrong type
input then it will so
*/
System.out.println("please Enter right input . please try again ");


}
}
}

Comments

Popular posts from this blog

Top 10 Data Analysis Tools For Your Business with Review Rated

  Top 10 Data Analysis Tools For Your Business with   Review and Rated            Data analysis  is one of the most backbone of the any success business now a days . you can not predict a success business without data analysis.  indirect or direct every business involve in Data analysis.  every business organization  want to make his own approach in the whole market through this Data analysis .  Example : what will demand of any product in Future    according to previous selling product or on demand  products  that why every business organization or business needs Data analysis . Here we will see that top 10 ten Data analysis Tools for your any business and if you are student and you are  interest to learn Data analysis and you need any free data analysis tool for exercise so don't  worry you will get two free tools with download link at the last of this all tools in this web page . There are manly two methods of data analysis: Qualitative Analysis Quantitative Analysis Qualitative

Function in Python programming language

  Function in Python? In Python, a function is a group of related statements that performs a specific task. Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organized and manageable. Furthermore, it avoids repetition and makes the code reusable. Syntax of Functio n def function_name ( parameters ): """ docstring """ statement(s) Above shown is a function definition that consists of the following components. Keyword  def  that marks the start of the function header. A function name to uniquely identify the function. Function naming follows the same rules of writing identifiers in Python. Parameters (arguments) through which we pass values to a function. They are optional. A colon (:) to mark the end of the function header. Optional documentation string (docstring) to describe what the function does. One or more valid python statements that make up the function body. Stateme

Glowing text in css

Glowing text in CSS Hello student in this tutorial we will see that how to make glowing text in css  so let's  break down this topic here . 1 . we taking a div or any tag, class, id for targeting text so here i am taking a id so first  we will center of this element through position absolute like this       #text  {              /* position center through position absolute*/              position :  absolute ;              top :  40 % ;              left :  50 % ;              transform :  translate ( -50 % ,  -50 % ); } 2. Again in this css we coding for text shadow like this through text-shadow carefully see of this code here and try in your code editer.             #text  {              /* position center through position absolute*/              position :  absolute ;              top :  40 % ;              left :  50 % ;              transform :  translate ( -50 % ,  -50 % );              /* text glowing like this pay attention here */              text-shadow :  0   0   4 px