0% found this document useful (0 votes)
3 views1 page

Step Ladder

The Java program calculates the cost based on the number of days entered by the user. It uses a series of conditional statements to determine the cost structure based on specific day ranges. The final cost is then printed to the console.

Uploaded by

sainidaksh01
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Step Ladder

The Java program calculates the cost based on the number of days entered by the user. It uses a series of conditional statements to determine the cost structure based on specific day ranges. The final cost is then printed to the console.

Uploaded by

sainidaksh01
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

import [Link].

*;

class stepladder

void main()

Scanner sc=new Scanner([Link]);

[Link]("Enter no. of days ");

int n=[Link]();

int c=0;

if(n<=17)

c=(5*10)+(7*5)+(10*(n-15));

else if(n<=15)

c=(5*10)+(7*(n-10));

else

c=5*n;

[Link]("the cost is "+c);

You might also like