Create an application for a library and name it FineForOverdueBooks. TheMain() method asks the user to input the number of books checked out and the number of days they are overdue. Pass those values to a method named DisplayFine that displays the library fine, which is 10 cents per book per day for the first seven days a book is overdue, then 20 cents per book per day for each additional day. The library fine should be displayed in the following format:

Respuesta :

Answer:

using System.IO;

using System;

class FineForOverdueBooks

{

static void Main()

{

Console.WriteLine("Enter the number of books user checked out: ");

int books = Convert. ToInt32(Console.ReadLine());

Console.WriteLine("Enter the number of overdue days: ");

int days = Convert. ToInt32(Console.ReadLine());

DisplayFine(books, days);

}

public static void DisplayFine(int books, int days) {

double amt = 0;

int d = days;

if(days>7) {

amt = (days-7) * .20 * books;

days = 7;

}

if(days > 0) {

amt = amt + days * .10 * books;

}

Console.WriteLine("The fine for {0} book(s) for {1} day(s) is {2}", books, d, amt);

}

}

Explanation: