Create an application for a library and name it FineForOverdueBooks. The Main() 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: The fine for 2 book(s) ft The numbers will vary based on the input.
Q: structions. subtractBigInteger() – When an integer has more than a certain number of digits, it is…
A: the code is an given below :
Q: Create a class named PremiumSugarSmashPlayer that descends from SugarSmashPlayer. This class is…
A: Solution is in Step 2.
Q: his is the question I am stuck on - The developers of a free online game named Sugar Smash have…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: This is the question - The developers of a free online game named Sugar Smash have asked you to…
A: The above program is trying to design and build the class named SugarSmashPlayer, holding data about…
Q: Write a java program called SumSquares that includes an integer return type method called Squares().…
A: public class SumSquares { /*Define an integer return type method called "Squares()" *…
Q: public class MoneyWithdrawal { private double balance; public withdrawMoney (double amount) { /*…
A: In the given options there is no correct option for replacing the missing code
Q: write an application that calculates and display the weekly salary for an employee.the main()…
A: logic:- calculate overtime only when overtime hour is not zero otherwise display normal result by…
Q: PS: Please upload the output and say the logic behind it. Thank you! 2. Create a class with a…
A: A year is considered a leap year if:i. It has an extra day i.e. 366 instead of 365.ii. It occurs…
Q: Netbeans 12.5. The question is: There are 12 inches in a foot and 3 feet in a yard. Create a class…
A: Please find the answer below
Q: Create a program named PaintingDemo that instantiates an array of eight Room objects and…
A: Program Explanation: Prompt for the width, length, and height Iterate to get the details for 4…
Q: a program to calculate Item's sale price 1) Ask user to enter the name of item e.g t-shirt 2) Ask…
A: code import java.util.Scanner; class Main{ public static void main(String args[]){ double…
Q: You will create a class called Square. Length will represent the length of one side which is an…
A: The mechanism of developing and implementing an executable computer program to achieve a particular…
Q: To encourage good grades, Hermosa High School has decided to award each student a bookstore credit…
A: writing code in java import java.util.*; class CreditBookstore { public static void fun(String…
Q: C# Create an application for a library and name itFineForOverdueBooks. TheMain() method asks the…
A: Given:- Create an application for a library and name itFineForOverdueBooks. TheMain() method asks…
Q: Fix the Java code, make sure: Leave comments as explaination how the code work. The program has no…
A: Please find the code with output and comments below
Q: Create a class named Commission that includes three variables: a double sales figure, a double…
A: Algorithm : Step 1 : declare class variables. computeCommission function : Parameters : double…
Q: class called Book to represent a book. A Book should include four pieces of information as private…
A: Program: // Java Programimport java.util.Scanner;// Book Class definitionclass Book { private…
Q: . Carly's Catering provides meals for parties and special events. In Chapters 3 and 4, you created…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: n netbeans, Write a method named costAfterDiscount that is passed 2 double parameters named Cost…
A: Dear Student, Your asked method is provided below
Q: Create an application named ConvertMilesToKilometers whose Main() method prompts a user for a number…
A: C# CODE TO COPY:- using System.IO;using System; class ConvertMilesToKilometers{static void…
Q: This is the question - The developers of a free online game named Sugar Smash have asked you to…
A: public class SugarSmashPlayer{ //instance variables ID, screenName private int idNumber;…
Q: Create a method that creates six random numbers between 10-20 which the method shall then return the…
A: I'm bound to provide the answer to only one of the given subparts. So, here is the answer to the…
Q: Write a GUI-based program to compute the new pay of an employee for a given pay raise rate. The…
A: Answer is given below-
Q: Write an application that uses methods in the LocalDate class to calculate how many days are left…
A: import java.time.*; import java.util.Scanner; public class DaysTilNextMonth{ public static void…
Q: Create a program in Java called TicketPurchase. Create a method called receipt that will print each…
A: The program is written in java. Please check the source code and output in the following steps.
Q: Create a class called Circle.java with fields named radius, area, and diameter. Include methods…
A: Circle.java public class Circle{ private double radius; private double area; private double…
Q: How would you calculate the odds of customer winning a single purchased Lotto Game? Well, what are…
A:
Q: Write a method named computeAvgScore that is passed 3 double parameters named exam1, exam2, exam3.…
A: import java.util.*; public class Main { public static double computeAverageScore(double a,double…
Q: Create a method that will display the transcript of the student, which must include the student…
A: Create a method that will display the transcript of the student, which must include the…
Q: The Westfield Carpet Company has asked you to write an application that calculates the price of…
A: public class RoomDimension { private double length; private double width; /** * @param…
Q: in java.Create a class named Customer that will determine the monthly repayment amount due by a…
A: Answer: CODE: Java Programming Language // Customer.java import javax.swing.JOptionPane;public class…
Q: Create a class name TestCheckup whose main method declares four Checkup objects. Call a getData()…
A: For the convenience of the user, instead of setter methods, the constructor is created to set the…
Q: Create a program named FindSquareRoot that finds the square root of a user’s input value. The Math…
A: Program: using System.IO; using System; class Program { static void Main() { double n; double result…
Q: you operate several hot dog stands distributed throughout town. Define class named HotDogStand that…
A: Define class HotDogStand. Define private variables ID and num. Define static private variable…
Q: Create a program named TipCalculation that includes two overloaded methods named DisplayTipInfo.…
A: Program approach: create a class define two overloaded method named DisplayTipInfo () one method…
Q: In this programming question, you are required to implement five methods according to the following…
A: The solution to the given problem is below.
Q: Create a class named Checkup with fields that hold a patient number, two blood pressure figures…
A: A C++ program for the first criteria including setter and getter methods is as follows, File name:…
Q: * In your main class: - Define a method called printItemDetails that takes an object of type Item…
A:
Q: Which method call includes arguments that are value-returning method calls? a. addNumbers (num1,…
A: Function or Methods A function is a block of code used to perform specific task in a program.…
Q: Class and Objets will be applied for the solution of given A Coffee Shop offers cups of : Coffee…
A: Since the program doesn't mention about the input for bill id or customers name so I am assuming we…
Q: Which code line could possibly call a method with the following header: public static int myMethod (…
A: In The Above Code Method myMethod(int x,double height) Having two Parameter x and height and It Has…
Q: Create a program for Smalltown Regional Airport Flights that accepts either an integer flight…
A:
Q: discount of 5%. Create a java application with bill class that includes bill id, customer
A: import java.util.Scanner; class Bill { public int id; public String name; public int…
Q: Create a program named PaintingEstimate whose Main() method prompts a user for length and width of a…
A: using System;using static System.Console;using System.Globalization;class PaintingEstimate{…
Q: To encourage good grades, Hermosa High School has decided to award each student a bookstore credit…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Question 11 Assuming you have this Java method: public static double computeGrade(int score) {…
A: 11)Given:public static double computeGrade(int score){//this method takes int parameter and returns…
Q: Create a method where a goblin will attack a zombie as long as the zombie has no health,…
A: Below is the method written in C++ as language not specified and sample output:
Q: The developers of a free online game named Sugar Smash have asked you to develop a class named…
A: There are three different codes of different classes. Save all the three java files in the same…
Q: create a class named checkup with fields that you read a patient number, blood pressure figures…
A: please see the class file in the second step. feel free to post the question or queries if you have…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- In Java I need to create a 2 new Student objects in a main method. The first will have name, major, 16 hours completed, and a 3.8 gpa. The 2nd will have name and major. they just started scool and have no hours completed or gpa. I need to change the 2nd students major. I need to update the students information based on hours they took and return a class level. public class Student{ private String name; private String major; private double gpa; private int hoursCompleted; /**Constructor * @param name * The student's name * @param major * The student's major */ public Student(String name, String major) { this.name = name; this.major = major; this.gpa = 0.0; hoursCompleted = 0; } /**Constructor * @param name * The student's name * @param major * The student's major * @param gpa * The student's cumulative gpa * @param hoursCompleted * Number of credit…public class BackAccount{public double Balance { set; get; }public void Deposit(double amount){Balance = Balance + amount;} }Transaction FeesTransaction TypeDeposit Withdrawal Check BalanceAmount0.25 % of the deposit amount 0.5 % of the withdrawal amount FreeUsing the code snippet above, complete the bank account functionality by adding Withdraw and CheckBalance methods. In your definition for the Withdraw method, check if the account has sufficient funds before making a withdrawal. Apply transaction fees as per the table above:The LocalDate class includes an instance method named lengthOfMonth() that returns the number of days in the month. Write an application that uses methods in the LocalDate class to calculate how many days are left until the first day of next month. Display the result in accordance with this example: There are 16 days until MAY starts. import java.time.*; import java.util.Scanner; public class DaysTilNextMonth { publicstaticvoidmain(String[] args) { // Write your code here } }
- Java Programming. Needs to be done with loops. Define a public static method called printPyramid(). This method should have publicstatic as its visibility modifiers. It should not return a value. It has a single integer parameter.When printPyramid() is called with an integer value, it should print a pyramid with a heightof that value.For example, if we call printPyramid() with an integer value of 5, then the following shouldbe displayed in the output console.** ** * ** * * ** * * * *You will have to use multiple for loops (consider nested for loops) to write this method.❏ In your main method, you should ask the user for the desired height of the pyramid. The usershould provide a value greater than 1. If the user does not provide a valid value, you should forcethe user to continue entering values until they enter a correct one.Then, call the printPyramid() method with the height given by the user.Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 3. Assume that "cal" is an instance of the java.util.Calendar class, which can return the current time of this Calendar in Milliseconds? A. System.out.println(cal.getTime());B. System.out.println(cal.getTimeInMillis());C. System.out.println(cal.getMillis());D. System.out.println(cal.getMillisTime());E. System.out.println(cal.getTimeMillis()); Part 2 - 4. Assume that "cal" is an instance of the java.util.Calendar class, which can set the month to February? A. cal.set(Calendar.MONTH, 1);B. cal.set(Calendar.MONTH, 2);C. cal.set(Calendar.MONTH, 3);D. cal.set(Calendar.MONTH, Feb);E. cal.set(Calendar.MONTH, February);1. Read the code below and complete tasks: public class CircleWithStaticMembers { double radius = 1; /* task 1: add a line of code to declare a static integer variable names numberOfObjects and initialize it to 0; */ /** Construct a circle with radius 1 */ CircleWithStaticMembers() { radius = 1; /* task 2: add a statement here so that each time this constructor is called, the number of static variable numberOfObjects increase by 1; */ } /* task 3: write a static method called getNumberOfObjects() which returns the value of numberOfObjects, write your code below; */ } // give the code below (assuming it’s in the main function) which calls the function getNumberOfObjects
- Write Unit Test Methods for the code snippets below: package InventoryManagement; /*** AddCommand*/public class AddProductCommand extends Command{//TODO: add necessary fields to this class public AddProductCommand(ProductCatalog productCatalog, User loggedOnUser){super(productCatalog, loggedOnUser); } @Overridepublic void Execute() {// TODO Add the code that will execute this command}} -------------- package InventoryManagement; import java.lang.reflect.Constructor; /*** Command*/public abstract class Command {//TODO: add necessary fields to this classpublic Command(ProductCatalog productCatalog, User loggedOnUser){ } public static Command CreateCommandDynamically(ProductCatalog productCatalog, User user, String commandClassName){Class<?> concreteCommandClass = null;Command command = null;String packageName = "InventoryManagement"; try {concreteCommandClass = Class.forName(packageName + "." + commandClassName);Constructor<?> con =…Modify the program below to create a class that contains a static method; the method takes a string as a parameter and returns a boolean value indicating whether the parameter string has repeated characters in it or not. That is, return true if there is at least one character which appears more than once in the string. The string should be input by the .user import java .util.*; public class Main{public static void main(String args[]){Scanner scn=new Scanner(System.in); // Input the string from userSystem.out.println ( "Enter the String to check for duplicate characters:");String str = scn.next();// Check is variable to store bool value true// It will change to true if there are repeated charactersboolean check=false;for (int a = 0; a < str.length(); a++)for (int b = a + 1; b < str.length(); b++)if (str.charAt(a) == str.charAt(b))check=true;// If check is true then string has repeated characters if (check)System.out.println("The String " + str + " has repeated…Class and Objets will be applied for the solution of given A Coffee Shop offers cups of : Coffee 1.5 $ Coffee Cake 3$ If the total charge exceeds 20$ the customer gets a discount of 5%. Create a java application with bill class that includes bill id, customer name, coffeeItems, cakeItems and the charge before and after discount. This class should implement addItems() method to add items to the customer bill and calcCharge() method to calculate the total charge. Class coffeeShop is expected to create a bill, adds items to this bill using menu and prints the charge.
- The L&L Bank can handle up to 30 customers who have savings accounts. Design and implement a program that manages the accounts. Keep track of key information, and allow each customer to make deposits and withdrawals. Produce appropriate error messages for invalid transactions. Hint: You may want to baseyour accounts on the Account class from Chapter 5. Also provide a method to add 3 percent interest to all accounts whenever the method is invoked.In Java: Create a class called Date that includes three instance variables-a month (type int), a day (type int) and a year (type int). Provide a constructor that initializes the three instance variables and assumes that the values provided are correct. Provide a set and a get method for each instance variable. Provide a method displayDate that displays the month, day and year separated by forward slashes (/). Add a main method to the class that demonstrates class Date's capabilities.GIVEN //BookMain.java//This is the client code of Book class public class BookMain{ public static void main(String[] arguments){// Small test of the Book classBook example = new Book("Angels and Demons");System.out.println("Title (should be Angels and Demons): " + example.getTitle());System.out.println("Rented? (should be false): " + example.isBorrowed());example.rented(); //marks the book as rentedSystem.out.println("Rented? (should be true): " + example.isBorrowed());example.returned();//marks the book as returnedSystem.out.println("Rented? (should be false): " + example.isBorrowed());} GIVEN //Book.java//complete the missing implementation to this class public class Book{private String title;private boolean borrowed; // Creates a new Book (constructor)public Book(String bookTitle){// Implement this method} // Marks the book as rentedpublic void rented() {// Implement this method} // Marks the book as not rentedpublic void returned() {// Implement this method} // Returns true if the…