-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreateSpaServices.java
33 lines (31 loc) · 1.1 KB
/
CreateSpaServices.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.Scanner;
/**
* CreateSpaServices
*/
public class CreateSpaServices
{
public static void main(String[] args)
{
SpaService firstService = new SpaService();
SpaService secondService = new SpaService();
firstService = getData();
secondService = getData();
System.out.println("\n\nFirst Service Details:\n"+firstService.getServiceDescription()+ "\t$"+firstService.getPrice()+"\n\n");
System.out.println("\n\nSecond Service Details:\n"+ secondService.getServiceDescription() + "\t$" + secondService.getPrice() +"\n\n");
}
public static SpaService getData() {
String service;
float price;
Scanner input=new Scanner(System.in);
SpaService obj= new SpaService();
System.out.print("Enter a service: ");
service= input.nextLine();
System.out.print("Enter a price: ");
price= input.nextFloat();
input.nextLine();
obj.setServiceDesctiption(service);
obj.setPrice(price);
input.close();
return obj;
}
}