Question: When solving the source code I keep getting the following error What am I doing wrong ? ? Customer.java package daway.s; private class Customer {
When solving the source code I keep getting the following error
What am I doing wrong
Customer.java
package daway.s;
private class Customer
private String name;
private String address;
private String phone;
private String email;
private String petName;
private String petType;
private int petAge;
private double petWeight;
public class Customer public CustomerString name, String address, String phone, String email, String petName, String petType, int petAge, double petWeight
this.name name;
this.address address;
this.phone phone;
this.email email;
this.petName petName;
this.petType petType;
this.petAge petAge;
this.petWeight petWeight;
public String getName
return name;
public String getAddress
return address;
public String getPhone
return phone;
public String getEmail
return email;
public String getPetName
return petName;
public String getPetType
return petType;
public int getPetAge
return petAge;
public double getPetWeight
return petWeight;
Invoice. Java
package daway.s;
public class Invoice
private static final double SALESTAXRATE ;
private Customer customer;
private double serviceCharges;
private double medicationCharges;
public InvoiceCustomer customer, double serviceCharges, double medicationCharges
this.customer customer;
this.serviceCharges Math.max serviceCharges;
this.medicationCharges Math.max medicationCharges;
private double calculateSalesTax
return Math.roundserviceCharges SALESTAXRATE ;
public double calculateTotalCharges
return serviceCharges medicationCharges calculateSalesTax;
public void printInvoice
DecimalFormat df new DecimalFormat#;
System.out.printlnCustomer Name: customer.getName;
System.out.printlnCustomer Address: customer.getAddress;
System.out.printlnCustomer Phone: customer.getPhone;
System.out.printlnCustomer Email: customer.getEmail;
System.out.printlnPet Name: customer.getPetName;
System.out.printlnPet Type: customer.getPetType;
System.out.printlnPet Age: customer.getPetAge;
System.out.printlnPet Weight: customer.getPetWeight;
System.out.printlnService Charges: $ dfformatserviceCharges;
System.out.printlnMedication Charges: $ dfformatmedicationCharges;
System.out.printlnSales Tax: $ dfformatcalculateSalesTax;
System.out.printlnTotal Charges: $ dfformatcalculateTotalCharges;
Main.java
package daway.s;
import java.util.Scanner;
public class Main
public static void mainString args
java.util.Scanner scanner new java.util.ScannerSystemin;
System.out.printEnter customer name: ;
String name scanner.nextLine;
System.out.printEnter customer address: ;
String address scanner.nextLine;
System.out.printEnter customer phone number: ;
String phone scanner.nextLine;
System.out.printEnter customer email: ;
String email scanner.nextLine;
System.out.printEnter pet name: ;
String petName scanner.nextLine;
System.out.printEnter pet type: ;
String petType scanner.nextLine;
System.out.printEnter pet age: ;
int petAge scanner.nextInt;
System.out.printEnter pet weight: ;
double petWeight scanner.nextDouble;
System.out.printEnter service charges: ;
double serviceCharges scanner.nextDouble;
System.out.printEnter medication charges: ;
double medicationCharges scanner.nextDouble;
Customer customer new Customername address, phone, email, petName, petType, petAge, petWeight;
Invoice invoice new Invoicecustomer serviceCharges, medicationCharges;
invoice.printInvoice;
scanner.close;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
