100 points
Please solve no.10
Please write every thing clear
Attachments:
Answers
Answered by
5
Answer:
import java.util.*;
public class Cloth
{
public static void main ( String args[ ] )
{
Scanner sc = new Scanner (System.in);
double dis, amt; String gift;
System.out.println ("Enter the total cost");
int cost = sc.nextInt( );
if (cost <= 2000)
{
dis = 5.0/100.0 * cost ;
amt = cost - dis ;
gift = Calculator ;
}
else if (cost > 2000 && cost <= 5000)
{
dis = 10.0/100.0 * cost ;
amt = cost - dis ;
gift = School bag ;
}
else if (cost > 5000 && cost <= 10000)
{
dis = 15.0/100.0 * cost ;
amt = cost - dis ;
gift = Wall Clock ;
}
else
{
dis = 20.0/100.0 * cost ;
amt = cost - dis ;
gift = Wrist Watch ;
}
System.out.println ("Amount to be paid =" +amt );
System.out.println (" Gift = " +gift );
}
}
Please mark my answer as brainliest if it is helpful for you...
Similar questions