Docs
Docs
import java.util.*;
int n, m;
double expo;
n = in.nextInt();
m = in.nextInt();
expo = Math.pow(n,m);
expo = Math.pow(m,n);
}}
import java.util.Scanne
double p = in.nextDouble();
double b = in.nextDouble();
}}
3) Write a program to input the cost price and the selling price of
an article. If the selling price is more than the cost price then
calculate and display actual profit and profit per cent otherwise,
calculate and display actual loss and loss per cent. If the cost
price and the selling price are equal, the program displays the
message 'Neither profit nor loss'.
import java.util.Scanner;
double cp = in.nextDouble();
double sp = in.nextDouble();
double pl = sp - cp;
if (pl > 0) {
else {
import java.util.Scanner;
double a = in.nextDouble();
double b = in.nextDouble();
double c = in.nextDouble();
double p = a + b + c;
double s = p / 2;
if (area == p)
else
import java.util.Scanner;
System.exit(0);
num /= 10;
if (grandSum == orgNum)
else
import java.util.Scanner;
amt2 -= d3;
}}
7) A library charges a fine for returning a book late after the due
date as per the conditions given below:
days day
import java.util.*;
int n = in.nextInt();
if (n <= 5)
fine = n * 2.0 ;
fine = 10 + (n - 5) * 5.0 ;
else
fine = 10 + 25 + (n - 10) * 10 ;
}}