Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions

Question

Critically evaluate research on the HRMperformance relationship

Answered: 1 week ago

Question

10:16 AM Sun Jan 29 Answered: 1 week ago

Answered: 1 week ago

Question

=+2 Why are so many countries bothered by their brain drains?

Answered: 1 week ago