write a program in java
Attachments:
Answers
Answered by
0
Answer:
create variables
get user input and store into variables
use if statement to check the days
e.g.
if(days<=7)
pardaycharges =100;
Answered by
0
Answer:
class a
{
void main(int days)
{
int cost;
if(days <= 7)
cost = days*1000;
else if(days > 7 && days <=15)
cost = (7*1000) + ((days - 7)*800);
else
cost = (7*1000) + (8*800) + ((days - 15)*700);
System.out.print("Cost = Rupees " + cost);
}
}
Similar questions