it's java from the chapter values and data types(class 9 ICSE)
Attachments:
Answers
Answered by
1
Explanation:
1.
import java.util.*;
public class camera
{
public static void main()
{
Scanner sc=new Scanner(System.in);
int n,double a;
System.out.println("Enter The Price");
n=sc.nextInt();
a=n-0.1*n;
a=a+0.06*a:
System.out.println("The amount is"+a+"rupees");
}
}
2.
import java.util.*;
public class camera
{
public static void main()
{
Scanner sc=new Scanner(System.in);
double a,d;
System.out.println("Enter The Price");
a=sc.nextInt();
d=a*0.3;
System.out.println("The Discount is "+d+"rupees from first shopkeeper");
d=a*0.2;
a-=d;
a=a*0.1;//for successive discount
d=d+a;
System.out.println("The Discount is "+d+"rupees from second shopkeeper");
}
}
Similar questions