#Help with this lab

1 messages · Page 1 of 1 (latest)

frosty valve
#

I can't seem to continue after CT Tax...What should I do next?

this is what I have currently:

package lab02;
import java.util.Scanner;

public class Lab02 {

public static void main(String[] args) {
    // Create a Scanner
    Scanner input = new Scanner(System.in);
   
    
    // Named Constants
     final double HAIRCUT_PRICE = 15.75;
   
     final double SHAVE_PRICE = 11.75;
    
     final double BEARD_TRIM_PRICE = 11.25;
     
     final double CT_TAX_RATE = 0.0635;
     
     final double HIGH_TIP_RATE = 0.20;
     
     final double LOW_TIP_RATE = 0.10;
     
     final double MED_TIP_RATE = 0.15;
     
     
                             // Named Variables

/******************************************/
System.out.println("Barber Shop Menu
");
System.out.println("
Haircut: $15.75 ");
System.out.println("
Shave: $11.75 ");
System.out.println("
Beard Trim: $11.25 ");
System.out.println("
");

/******************************************************************************/
// Received the amount of haircuts
System.out.print("Enter the number of haircuts:");
double haircuts = input.nextDouble();

double totalhaircuts = HAIRCUT_PRICE * haircuts;



                    // Received the amount of shaves
                     System.out.print("Enter the number of shaves:"); 
                         double shaves = input.nextDouble();
 
                                double totalshaves = SHAVE_PRICE * shaves;
 
 

 // Received the amount of beard trims
System.out.print("Enter the number of beard trims:");   
double beardtrims = input.nextDouble();

double totalbeardtrims = BEARD_TRIM_PRICE * beardtrims;

/******************************************************************************/

// Display results
System.out.print("Haircuts total:" + "$" + (totalhaircuts));

               System.out.print("Shaves total:" + "$" + (totalshaves));

                       System.out.print("Beard trims total:" + "$" + (totalbeardtrims));

                       
                       double totalsales = ((int)(totalhaircuts + totalshaves +totalbeardtrims));

/******************************************************************************/
System.out.println("------------------------------------");

// Display results

System.out.print("Services:" + (totalsales));

System.out.print("CT tax:" + CT_TAX_RATE * ((int) (totalhaircuts + totalshaves +totalbeardtrims)) );

System.out.print("Total bill:");

}

}

main thornBOT
#

<@&987246399047479336> please have a look, thanks.

main thornBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

elder moon