Question: static void Main ( ) { double days,books; Console.WriteLine ( Enter the number of books ) ; books = double.Parse ( Console . ReadLine

static void Main()
{
double days,books;
Console.WriteLine("Enter the number of books");
books = double.Parse(Console.ReadLine());
Console.WriteLine("Enter the number of days");
days = double.Parse(Console.ReadLine());
// Here we call the DisplayFine method with the help of the class name so that the method is accesible
FineForOverdueBooks.DisplayFine(books,days);
}
public static void DisplayFine(double books,double days)
{
double fine=0;
if(days<=7)
fine=days*books*.10;
else
fine=books*(.70+(days-7)*.20);
Console.Write("The fine for {0} book(s) for {1} day(s) is {2}", books, days, fine.ToString("C"));
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!