write a java program to accept ‘M’or ‘F’ and price of a product.if gender is M discount on product is 10% else it is 20%
Answers
Answered by
1
Answer:
import java.util.scanner
class discount
{
public static void main (string args[])
{
long disc;
long amt;
Scanner SC= new scanner( system.in);
sopln("enter M if male
enter F if female");
string s= SC.nextLine();
if( s=M)
{
long disc= 0.10*amt;
}
else
{
long disc =0.20*amt;
}
sopln(" You entered "+s" your discount is "+disc);
}
}
Similar questions
Math,
4 months ago
Math,
4 months ago
Political Science,
4 months ago
Math,
9 months ago
Math,
9 months ago
Social Sciences,
1 year ago