1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
rosijanka [135]
3 years ago
9

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:
Computers and Technology
1 answer:
user100 [1]3 years ago
7 0

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:

You might be interested in
What is Service Oriented architecture & How is it different form Object Oriented Middleware?
topjm [15]

Answer: This can be explained s follows :-

Explanation: The approach in which services available in the network are used by the applications is called service oriented architecture. In such structure a business function is provided by each service that is independent of other services.

Object oriented programming is a programming paradigm. OOP can be used outside of that architecture or it can be apart of SOA as well .

3 0
3 years ago
At a murder scene, you have started making an image of a computer’s drive. You’re in the back bedroom of the house, and a small
GrogVix [38]

To preserve data, If you've previously emptied the RAM and registry, you may simply disconnect the power from the rear of the PC and remove the drive from the case; otherwise, if you want to save the entire system, you can carry the entire case with you.

<h3>What is a hard disk?</h3>

A hard disk drive or hard drive is a storage device that store data in an electronic device.

Thus, to preserve data, If you've previously emptied the RAM and registry, you may simply disconnect the power from the rear of the PC and remove the drive from the case; otherwise, if you want to save the entire system, you can carry the entire case with you.

Learn more about hard disk

brainly.com/question/14504942

#SPJ1

6 0
2 years ago
Follow me please.........​
devlian [24]

thank you for the free points.

4 0
3 years ago
All of the following are examples of what rigorous coursework in high school might mean except: A) added reading assignments. B)
faust18 [17]

Answer:b

Explanation:

3 0
4 years ago
Read 2 more answers
Write a program to declare a matrix A[][] of order (MXN) where ‘M’ is the number of rows and ‘N’ is the
Liula [17]

Answer:

import java.io.*;

import java.util.Arrays;

class Main {

   public static void main(String args[])

   throws IOException{

       // Set up keyboard input

       InputStreamReader in = new InputStreamReader(System.in);

       BufferedReader br = new BufferedReader(in);

 

       // Prompt for dimensions MxN of the matrix

       System.out.print("M = ");

       int m = Integer.parseInt(br.readLine());

       System.out.print("N = ");

       int n = Integer.parseInt(br.readLine());

       // Check if input is within bounds, exit if not

       if(m <= 2 || m >= 10 || n <= 2 || n >= 10){

           System.out.println("Matrix size out of range.");

           return;

       }

       // Declare the matrix as two-dimensional int array

       int a[][] = new int[m][n];

 

       // Prompt for values of the matrix elements

       System.out.println("Enter elements of matrix:");

       for(int i = 0; i < m; i++){

           for(int j = 0; j < n; j++){

               a[i][j] = Integer.parseInt(br.readLine());

           }

       }

       // Output the original matrix

       System.out.println("Original Matrix:");

       printMatrix(a);

       // Sort each row

       for(int i = 0; i < m; i++){

         Arrays.sort(a[i]);

       }

       // Print sorted matrix

       System.out.println("Matrix after sorting rows:");

       printMatrix(a);

   }

   // Print the matrix elements separated by tabs

   public static void printMatrix(int[][] a) {

       for(int i = 0; i < a.length; i++){

           for(int j = 0; j < a[i].length; j++)

               System.out.print(a[i][j] + "\t");

           System.out.println();

       }

   }

}

Explanation:

I fixed the mistake in the original code and put comments in to describe each section. The mistake was that the entire matrix was sorted, while only the individual rows needed to be sorted. This even simplifies the program. I also factored out a printMatrix() method because it is used twice.

4 0
3 years ago
Other questions:
  • Which of the following was one of the first internet search engines? A. archie B. google C. Yahoo D.ask
    7·1 answer
  • What file holds the preferences and settings of the currently signed-in user??
    9·1 answer
  • Write a function (funception) that takes in another function func_a and a number start and returns a function (func_b) that will
    7·1 answer
  • Write a method that takes three numerical String values and sums their values.
    14·2 answers
  • Daniel owns a construction company that builds homes. To help his customers visualize the types of homes he can build for them,
    6·1 answer
  • I plugged my headphones into my computer, but the sound still came out of the speakers. help!
    6·2 answers
  • What is the primary difference between the windows server 2012 r2 server manager and previous versions (before windows server 20
    11·1 answer
  • Which statement gives an advantage of multicellular organisms?
    7·2 answers
  • ITEMS
    9·1 answer
  • It is the responsibility of a manager to understand the company’s IT architecture and corresponding infrastructure so that the
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!