Question

In: Computer Science

Covered chapters: 1 ~ 3 In our first lab of the semester, we will create a...

Covered chapters: 1 ~ 3 In our first lab of the semester, we will create a Java CLI application that enables a store owner to calculate and out put the cost of a product. As the owner you determine the store name, product, cost, and hours it takes to make the product. Your output should display all pertinent information in a readable format. Lab Parameters Using Exercise 10 on page 165 of the textbook as a starting point, create an application that gets the following from user: Job Name Cost of Materials On the job time (in hours) Travel time to job site (in hours) Make sure to use the parameters and calculation formula noted in the exercise to compute the final costs. For instance, if the cost of material is $10, and the hours needed to repair is 2, and hours needed to reach the site is 2, then the final cost of repair would be the cost of material ($10) plus $35 multiplied by the number of hours of work (2) required for the repair, plus $12 multiplied by the travel time (2). The repair cost would come out to be 10 + 35 * 2 + 12*2 = $104 Once the application has all the input and processed it, output the results with all relevant information. Make sure you add following: Place a company name (you make up the company) formatted at the top with a design as you deem appropriate. Detailed invoice for the product. For example, include pertinent items used to calculate the cos Important Notes/Requirements Use NetBeans IDE for this lab Follow variable and file naming conventions Use appropriate data types Document every file that you create and/or change Create a class that contains a main() method that prompts user for all the inputs Pass the numeric data to a method that calculates the retail price for the job and returns the computed value to the main() method where the product name and price are displayed. Save the program using our usual naming convention: i.e., Lab1jsmith.java

Solutions

Expert Solution

Thanks for the question.

Below is the code you will be needing  Let me know if you have any doubts or if you need anything to change.

Thank You !!

===========================================================================

import java.util.Scanner;

public class Lab1jsmith {


    public static void main(String[] args) {

        final double HOURLY_RATE = 35.00;
        final double TRAVEL_TIME_COST = 12;

        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter job name: ");
        String jobName = scanner.nextLine();
        System.out.print("Cost of material: $");
        double costOfMaterial = scanner.nextDouble();
        System.out.print("On job time (in hours): ");
        double hours = scanner.nextDouble();
        System.out.print("Travel time to job site (in hours): ");
        double travelTime = scanner.nextDouble();

        double totalCost = costOfMaterial+hours*HOURLY_RATE+travelTime*TRAVEL_TIME_COST;

        System.out.println("JOB NAME: "+jobName);
        System.out.println("COST OF MATERIAL: $"+String.format("%.2f",costOfMaterial));
        System.out.println("JOB TIME (HOURS): "+String.format("%.2f",hours));
        System.out.println("TRAVEL TIME (HOURS): "+String.format("%.2f",travelTime));
        System.out.println("TOTAL COST: $"+String.format("%.2f",totalCost));

    }


}


Related Solutions

Create the entity of your choice based on the entities covered in the assigned chapters. You...
Create the entity of your choice based on the entities covered in the assigned chapters. You must draft or fill out the proper form or forms required to create the entity, i.e. partnership you would fill out the forms required by the state of Illinois to form a partnership. Once you have created your chosen entity. You must explain the steps you took to create the entity. Fill out form, requested business name, filed documents with the state, etc. whatever...
In the first half of the semester, we discussed 3 examples of situations in which psychology...
In the first half of the semester, we discussed 3 examples of situations in which psychology has been unethical. Pick one of those situations, describe the situation, and discuss why it was unethical. Discuss 3 of 4 factors that are involved in informed consent.              
In my lab we found OUR average molarity to be 0.83334 M, but we used 3%...
In my lab we found OUR average molarity to be 0.83334 M, but we used 3% H2O2 (hydrogen peroxide), so I'm not sure how to do this or what numbers to even use. 7. Convert the average molarity of hydrogen peroxide into % (wt) of hydrogen peroxide (the density of the solution = 1.009g/ml). 8. Comparing the above calculated % of hydrogen peroxide with the known (labeled on the bottle) value, calculate the % experimental error.
Over the semester we have learned that one of the three pillars of our economy is...
Over the semester we have learned that one of the three pillars of our economy is capital expenditures (CAPEX) by private and public businesses. On an annual basis companies allocate a certain amount of their free cash to develop projects that will facilitate company growth and earnings, which will, in turn, improve stock prices and shareholder value. Inside this process is the selection of projects that will be selected among many different available projects. Those companies that make the best...
In lab this semester, we have examined several cellular molecules and activities including, but not limited...
In lab this semester, we have examined several cellular molecules and activities including, but not limited to, cyclosis in Elodea, Protein concentration in various food sources, bovine serum albumin and the relationship between protein concentration and absorbance, Betacyanin and membrane permeability, B-galactosidase and enzyme function, yeast cell growth, and RNA production in cells. Describe how one of more of the databases/programs utilized in this lab exercise (pBLAST, PDB, DeepLoc, KEGG) could be used to gain information about one of these...
3) In the country of Upper Sasdonia of Alemania, in the first semester, there are 60...
3) In the country of Upper Sasdonia of Alemania, in the first semester, there are 60 people employed, 25 unemployed, and 15 out of the labor force. At the end of the first semester, 5 workers got fired and are still searching, 10 workers got fired but aren’t searching, 5 unemployed people got hired, 10 unemployed workers got discouraged, 5 out of the labor force found a job directly, and 5 out of the labor force started searching. a. What...
In our discussion of the regulation of gene expression in eukaryotes, we covered the Gal1 locus...
In our discussion of the regulation of gene expression in eukaryotes, we covered the Gal1 locus of yeast. (a) In the space below, draw out the general cis and trans elements of the yeast Gal1 locus in the presence of Galactose (Gal1 gene is expressed, +Galactose). (b) What is one aspect of the regulation of Gal1 expression (in the activated or repressed state) that is conceptually distinct from the regulation of the prokaryotic lac operon in E.coli? (c) In class,...
: Our final topic of the semester was informal fallacies. We talked about several types of...
: Our final topic of the semester was informal fallacies. We talked about several types of common fallacies and ways of diagnosing what went wrong in each. In these cases where someone provides a fallacious argument, people reason in accordance with bad arguments. Throughout the semester you have also learned several tools for identifying and diagnosing what makes arguments good. Describe an instance of bad reasoning that you have encountered or that you think is common using the tools we...
For this lab, we will create a spreadsheet that allows somebody to type in a loan...
For this lab, we will create a spreadsheet that allows somebody to type in a loan amount, interest rate, and length of the loan in years. The spreadsheet will then calculate the monthly payment required and the actual amount paid on the loan. First, setup your spreadsheet: In Cell A1, put the label Loan Amount:. The corresponding value would be input in Cell B1. In Cell A2, put the label Interest Rate:. The corresponding value would be input in Cell...
In our lab experiment, we filtered CaCl and CaOH2 solutions that we prepared the previous week...
In our lab experiment, we filtered CaCl and CaOH2 solutions that we prepared the previous week and transferred both of the filtrates using a 25 ml pipette into two erlenmeyer flasks. We then prepared the standard HCl by pipeting 100 ml of HCl to prepare 250 ml of 0.04M HCl from the 0.1 M HCl solution that we initially had. We pipeted 100 ml of HCl into a 250 ml volumetric flask and diluted to the mark. The buret was...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT