In: Computer Science
Wilson Car Repair must record information about customer’s vehicles that are coming in for repair. A program is needed to record the customer name, phone number, Type of work done, type of car, the number of labor hours, and the total amount for the parts, and a grand total amount for the repair of the vehicle. A 10% discount will be given if paid in cash. If the customer is a member of the “Wilson Car Repair Savings Club,” they get a 20% discount. You can adjust this project in any way you want. Just make sure you are doing some calculations.
You can adjust this project in any way you want.
You can make it easier or more challenging. Just make sure you are doing some calculations.
Be sure to submit an IPO along with your input screen and your output screen. You can draw screens or use Visio to make them.
import java.util.Scanner;
class Main
{
public static void main(String[] args)
{
//variable declaration
String name,ph,work_type,pay_mode,club_member;
double parts_amt,labour_hour;
double tp,grandpay,dis1,dis2;
grandpay=0.0;
tp=0.0;
dis1=0.0;
dis2=0.0;
Scanner sc=new Scanner(System.in);
//accepting the detals from user
System.out.println("Wilson Car Repair Club");
System.out.println("Enter the Customer name");
name=sc.nextLine();
System.out.println("Enter the Customer phone number");
ph=sc.nextLine();
System.out.println("Enter the Type of work");
work_type=sc.nextLine();
System.out.println("Enter the Labour Hour");
labour_hour=sc.nextDouble();
System.out.println("Enter the Total amount for the parts");
parts_amt=sc.nextDouble();
System.out.println("Amount to be paid by Cash or card");
pay_mode=sc.next();
System.out.println("Is the Customer Member of Wilson Car Repair Savings Club(Yes or No)");
club_member=sc.next();
//calculating discount if mode is cash
if(pay_mode.equalsIgnoreCase("Cash"))
dis1=0.1;
//calculating discount if customer is club memeber
if(club_member.equalsIgnoreCase("Yes"))
dis2=0.2;
//calculating the Total cost
tp=parts_amt+labour_hour*8;
grandpay=tp-((dis1*tp)+(dis2*tp));
//displaying the result
System.out.println("Customer Name : "+name);
System.out.println("Phone Number : "+ph);
System.out.println("Work Type : "+work_type);
System.out.println("Payment Mode : "+pay_mode);
System.out.println("Member of Wilson Car Repair Savings Club : "+club_member);
System.out.println("Total Payment : "+grandpay);
}
}
OUTPUT

