package com.samovich.cop2800.chapter3;

import java.util.Scanner;

/**
 * Filename CreateSpaServices.java
 * Created by Valery Samovich
 * Written on 5/23/2016
 */
public class CreateSpaServices {

    public static void main(String[] args) {

        // declare objects
        SpaService firstService = new SpaService();
        SpaService secondService = new SpaService();
        SpaService thirdService = new SpaService();

        firstService = getData(firstService);
        secondService = getData(secondService);

        // display the details for first service
        System.out.println("First service details:");
        System.out.println(firstService.getServiceDescription() + " $" +
                firstService.getPrice());
        System.out.println("Second service details:");
        System.out.println(secondService.getServiceDescription() + " $" +
                secondService.getPrice());
        System.out.println("Third service details:");
        System.out.println(thirdService.getServiceDescription() + " $" +
                thirdService.getPrice());
    }

    public static SpaService getData(SpaService s){

        // declare variables
        String service;
        double price;

        // declare object
        Scanner keyboard = new Scanner(System.in);

        System.out.print("Enter service >> ");
        service = keyboard.nextLine();
        System.out.print("Enter price >> ");
        price = keyboard.nextDouble();
        keyboard.nextLine();

        s.setServiceDescription(service);
        s.setPrice(price);
        return s;
    }
}

@@ -233,24 +233,100 @@
 %5B%5D args) %7B%0A%0A
+        // declare variables%0A        String service;%0A        double price;%0A%0A
         // d
@@ -383,32 +383,50 @@
 ew SpaService();
+     // by Scanner
 %0A        SpaServ
@@ -458,24 +458,44 @@
 paService();
+    // by Data Entry
 %0A        Spa
@@ -538,55 +538,440 @@
 e();
-%0A%0A        firstService = getData(firstService);
+     // by Constructor%0A%0A        // declare object%0A        Scanner keyboard = new Scanner(System.in);%0A%0A        System.out.print(%22Enter service %3E%3E %22);%0A        service = keyboard.nextLine();%0A        System.out.print(%22Enter price %3E%3E %22);%0A        price = keyboard.nextDouble();%0A%0A        // recall the set methods%0A        firstService.setServiceDescription(service);%0A        firstService.setPrice(price);%0A%0A        // call data entry method
 %0A   

Update to support Scanner