Question: NEED THIS IN 30 MINUTES PLEASE Java programming: I need some help on this, I have include one of my previous assignments below. 1. Create
NEED THIS IN 30 MINUTES PLEASE
Java programming: I need some help on this, I have include one of my previous assignments below.
1. Create a function/method to read in one of your data items. Nothing will be passed in and the data item will be passed back.
2. create a function/method to perform one of your calculations. You will have to pass all needed data and pass back the resulting value calculated.
3. Create a function/method to do some of the required printing. The values to be printed will be passed in and nothing will be passed back.
Here is my previous assignment PLEASE EDIT IT TO FIT IN WITH THE 3 INSTRUCTIONS ABOVE:
import javax.swing.JOptionPane;
public class Bill
{
public static void main(String[]args)
{
String name, data,output;
double discount, fee, findue, Materials, Total;
int Hours;
//input data
name=JOptionPane.showInputDialog(null, "Construction Firm Name","Input Data",JOptionPane.QUESTION_MESSAGE);
name=JOptionPane.showInputDialog(null,"Customer Name","Input data",JOptionPane.QUESTION_MESSAGE);
data=JOptionPane.showInputDialog(null,"Number of labor hours","Input data",JOptionPane.QUESTION_MESSAGE);
Hours=Integer.parseInt(data);
data=JOptionPane.showInputDialog(null,"Amount of materials","Input data",JOptionPane.QUESTION_MESSAGE);
Materials=Double.parseDouble(data);
//calculations
Total=Hours*50;
fee=Total+Materials;
discount=fee*.10;
findue=fee-discount;
//Print results
System.out.println("Construction Firm Name:"+name+" ");
System.out.println("Customer:"+name+" ");
System.out.println("Number of Hours="+Hours);
System.out.println("Labor="+Hours);
System.out.println("Materials="+Materials);
System.out.println("Job Fee=" +fee);
System.out.println("Discount="+discount+" ");
System.out.println("Final Amount Due="+findue);
System.exit(0);
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
