Set 2
Set 2
Scanner;
2. import java.util.Scanner;
4. import java.util.Scanner;
public class ss
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter price of article: ");
double price = in.nextDouble();
5. import java.util.Scanner;
System.out.println(hrs
+ " Hours "
+ mins
+ " Minutes "
+ secs
+ " Seconds");
}
}
6. import java.util.Scanner;
7. import java.util.Scanner;
public class mm
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter the selling price: ");
double sp = in.nextDouble();
double cp1 = (sp / (1 + (20 / 100.0)));
double cp2 = (sp / (1 - (20 / 100.0)));
double totalCP = cp1 + cp2;
System.out.println("Total Cost Price = " + totalCP);
}
}
8. import java.util.Scanner;
public class jj
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter Perpendicular: ");
double p = in.nextDouble();
System.out.print("Enter Base: ");
double b = in.nextDouble();
9. import java.util.Scanner;
System.out.println(years + " Years " + months + " Months " + d + " Days");
}
}
10. import java.util.Scanner;