Language = JAVA
Create a new Java file called PhotoBillingYourLastName with a public static void main.
Create three overloaded computePhotoBill() methods for Shutterfly.
When computePhotoBill() receives a single double parameter, it represents the price of one photo book ordered. Add 6% tax and return the total due as a double.
When computePhotoBill() received two parameters, they represent the price of a photo book and the quantity ordered (int). Multiply the two values, add 6% tax and return the total due.
Finally, when computePhotoBill() receives three parameters, they represents the price of a photo book, the quantity ordered, and a coupon value. Multiple the quantity and price for a new subtotal, compute the coupon discount by multiplying the coupon value by subtotal, the reduce the subtotal by the calculated coupon value. Finally, add 6% tax and return the total due.
In the main method, call each method testing to make sure you receive the correct values and back. For example, with these calls (using printf to two decimals), I would receive the following:
computePhotoBill(19.99); // 21.19
computePhotoBill(19.99, 2); // 42.38
computePhotoBill (19.22, 2, .1); // 36.67
import java.util.*;
import java.lang.*;
import java.io.*;
import java.text.DecimalFormat;
class PhotoBillingYourLastName
{
public double computePhotoBill(double price)
{
price=price+0.06*price;
return price;
}
public double computePhotoBill(double price,int quantity)
{
price=price*quantity;
price=price+0.06*price;
return price;
}
public double computePhotoBill(double price,int quantity,double
coupon)
{
price=price*quantity;
double discount=price*coupon;
price=price-discount;
price=price+0.06*price;
return price;
}
public static void main (String[] args)
{
DecimalFormat df = new
DecimalFormat("#,###,##0.00");
PhotoBillingYourLastName obj=new
PhotoBillingYourLastName();
System.out.println(df.format(obj.computePhotoBill(19.99)));
System.out.println(df.format(obj.computePhotoBill(19.99,
2)));
System.out.println(df.format(obj.computePhotoBill (19.22, 2,
.1)));
}
}


Please upvote if you found this solution useful and comment for any doubts.
Language = JAVA Create a new Java file called PhotoBillingYourLastName with a public static void main....
Create a class named Billing that includes four overloaded computeBill() methods for a photo book store. When computeBill() receives a single parameter, it represents the price of one photo book ordered. Add 8.5% tax, and return the total due. When computeBill() receives two parameters, they represent the price of a photo book and the quantity ordered. Multiply the two values, add 8.5% tax and return the total due. When computeBill() receives three parameters, they represent the price of a photo...
Create a class named Billing that includes three overloaded computeBill() methods for a photo book store. • When computeBill() receives a single parameter, it represents the price of one photo book ordered. Add 8% tax, and return the total due. • When computeBill() receives two parameters, they represent the price of a photo book and the quantity ordered. Multiply the two values, add 8% tax, and return the total due. • When computeBill() receives three parameters, they represent the price...
Language = Java Create a program to receive book prices until a sentinel value is entered. (Be sure to tell your user what the sentinel value is so they can type it to indicate they are finished with entering input.) After the sentinel value is entered, compute the total book order total and return the following to the user. As book prices are entered, you'll need to have some way to capture the number of books they ordered and the...
In a new file located in the same package as the class Main, create a public Java class to represent a photograph that consists of a linear (not 2D) array of pixels. Each pixel is stored as an integer. The photograph class must have: (a) Two private fields to represent the information stored about the photograph. These are the array of integers and the date the photograph was taken (stored as a String). The values in the array must be...
Write code in Java programming language. The ShoppingCart class will be composed with an array of Item objects. You do not need to implement the Item class for this question, only use it. Item has a getPrice() method that returns a float and a one-argument constructor that takes a float that specifies the price. The ShoppingCart class should have: Constructors: A no-argument and a single argument that takes an array of Items. Fields: • Items: an array of Item objects...
Use java, you are to create a brand new base class called NSpaceCoordinate in a file called nspace/NSpaceCoordinate.java. It has the following requirements: 1. It must have a single private field, an ArrayList specialized (using the generics feature discussed in the lecture) to holding values of type double (actually, Double). 2. Provide a constructor that takes a double[] and sets up the ArrayList field to have those same values. 3. Provide a method called getNthCoordinate(int i). 4. Implement the Comparable...
My Java code from last assignment:
Previous Java code:
public static
void main(String args[]) {
// While loop set-up
boolean flag = true;
while (flag) {
Scanner sc = new
Scanner(System.in);
// Ask user to enter employee number
System.out.print("Enter employee
number: ");
int employee_number = sc.nextInt();
// Ask user to enter last name
System.out.print("Enter employee last
name: ");
String last_name = sc.next();
// Ask user to enter number of hours worked
System.out.print("Enter number of
hours worked: ");
int hours_worked =...
My Java code from last assignment:
Previous Java code:
public static
void main(String args[]) {
// While loop set-up
boolean flag = true;
while (flag) {
Scanner sc = new
Scanner(System.in);
// Ask user to enter employee number
System.out.print("Enter employee
number: ");
int employee_number = sc.nextInt();
// Ask user to enter last name
System.out.print("Enter employee last
name: ");
String last_name = sc.next();
// Ask user to enter number of hours worked
System.out.print("Enter number of
hours worked: ");
int hours_worked =...
Create a Java file called CompoundInterestYourLastName. Write a method called computeBalance( ) that computes the balance of a bank account with a given initial deposit, annual interest rate, after a given number of years for the investment. Assume interest is compounded yearly. The formula for determining compound interest (compounded yearly) is: A space equals space P space left parenthesis space 1 plus r space right parenthesis space to the power of t space where: A = the future value of...
Some java questions:
18. Consider the following class definitions public class TestAB public static void main (String args) A bl new B() в ь2 -new B() ; b1.х, А.у, Ь2.х, в.у); System.out.printf ("%d, Sd, %d, d\n", class A public int x = 2; public static int y = 4; public A () ( X=y- class Bextends A public int x = 32; public static int y = 45; public B ( x ++y What is the result of attempting to...