Skip to main content

Posts

Showing posts with the label BCA

ads1

JAVA PROGRAM || Write a JAVA program to enter P, T, R and calculate Simple Interest.

                                                 JAVA PROGRAM Write a Java program to enter P, T, R and calculate Simple Interest.   (Hint) Simple Intereset = P*R*T/100   Static  class SimpleInterest {     public static void main(String args[])     {         double p=25000.50,r=8.5,t=5;         double sp = p * r * t/100;         System.out.println("The simple interset is :- "+sp);     } }   Output :-     Dynamic :-  import java.util.*; class SimpleInterest {     public static void main(String args[])     {           Scanner in = new Scanner(System.in);      System.out.println("Enter the Principle amount :-");     double principle = in.nextDouble();     System.out.println("Enter the Rate of interest :-");     double rate = in.nextDouble();     System.out.println("Enter the Time period  :-");     double time = in.nextDouble();     double sp = principle * rate * time/100;     System.out.println("The simple interset is :- "+sp);     } } Out

JAVA PROGRAM || Write a JAVA program to enter marks of five subjects and calculate total, average and percentage.

                                                                                            JAVA PROGRAM   Write a Java program to enter marks of five subjects and calculate total, average and percentage.   (Hint)  Total = s1+s2+s3+s4+s5 Average = total/5 percentage = (total/500)*100 Static :-  class TAP {     public static void main(String args[])     {         double english=50.0,Maths=65.5,SocialScience=72.5,Science=49.0,Computer=48.5,total,average,percentage;         total=english+Maths+SocialScience + Science + Computer;         average = total/5;         percentage = (total/500)*100;         System.out.println("The total marks is :-"+total);         System.out.println("The average  is :-"+average);         System.out.println("The percentage is :-"+percentage);                  } }   Output :-      Dynamic :-  import java.util.*; class TAP {     public static void main(String args[])     {         Scanner in = new Scanner(System.in);         System.ou

JAVA PROGRAM || Write a JAVA program to convert days into years, weeks and days.

                                                                                       Write a Java  program to convert days into years, weeks and days.   (hint)  year = days/365 week = (day % 365)/7) days = days-(year*365)+(weeks*7)) Static :- class YWD {     public static void main(String args[])     {         int day=500;         int year,week,days;         year = (day/365);         week = (day % 365)/7;         days = day-((year*365)+(week*7));         System.out.println("The number of year :- "+year);         System.out.println("The number of week :- "+week);         System.out.println("The number of days :- "+days);     }    } Output :-    Dynamic :- import java.util.*; class YWD {     public static void main(String args[])     {         Scanner in = new Scanner(System.in);         System.out.println("Enter the number of Days :- ");         int day = in.nextInt();         int year,week,days;         year = (day/365);         week = (day % 3

JAVA Program || Write a Java program to enter temperature in Fahrenheit and convert to Celsius.

                                                 Write a Java program to enter temperature in Fahrenheit and convert to Celsius   (Hint) C= (f-32)*9/5 Static :-  class Celsius {     public static void main(String args[])     {         Double fah = 205.0;         Double cel;         cel = (fah - 32)*5/9;         System.out.println("The temperature in Celsius is :- "+cel);     } } Output :-    Dynamic  import java.util.*; class Celsius {     public static void main(String args[])     {         Scanner in = new Scanner(System.in);         System.out.println("Enter the Temperature in Faherenheit :-");         double fah = in.nextDouble();         double cel = (fah-32)*5/9;         System.out.println("The temperature in Celsius is :- "+cel);     } } Output :-         

Java Program || Write a Java program to enter length in centimeter and convert it into meter and kilometer.

                                                                                             Java Program  Write a Java program to enter length in centimeter and convert it into meter and kilometer.   Solution :-  meter = cm / 100.0; km    = cm / 100000.0;   Static :-  class convert {     public static void main(String args[])     {         double cm=1000,meter,km;         meter = cm/100.0;         km = cm/100000.0;         System.out.println("The meter :-"+meter);         System.out.println("The Kilometer is :-"+km);              }     } Output :-    Dynamic :-  import java.util.*; class convert {     public static void main(String args[])     {         Scanner in = new Scanner(System.in);         System.out.println("Enter the cm :- ");         int cm = in.nextInt();         double meter = cm/1000.0;         double km = cm/100000.0;         System.out.println("The meter :-"+meter);         System.out.println("The Kilometer is :-"+km);

ads2