Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Starting code: /* Programmer: Date: Project: Bonus Lab 2.1 Hardware File Name: Hardware.java Program Description: Determines the price of an order from a hardware store.

image text in transcribed
Starting code:

/* Programmer:

Date:

Project: Bonus Lab 2.1 Hardware

File Name: Hardware.java

Program Description: Determines the price of an order from a hardware store.

*/

import java.util.*;

public class Hardware {

public static void main(String[] args){

// Variable to accept the user's input

Scanner keyboard = new Scanner(System.in);

// Enter your code here

}

}

Assignment Taken From Bradley Kjell, Central Connecticut State University Bob's Discount Bolttolowng prices .5 cents per bolt 3 cents per nut cent per washer Write a program Hardware,java that asks the user for the number of bolts, nuts, and washers in their purchase and then calculates and prints out the total As an added feature, the program checks the order. A correct order must have at least as many nuts as bolts and at least twice as many washers as bolts; oterwise the order has an error. For an error the program writes out "Check the Order: too few nuts" or "Check the Order: too few washers" as appropriate. Both error messages are written if the order has both errors specified number of items) is written out. Number of bolts: 12 Number of nuts: 8 Number of washers: 24 Check the Order: too few nuts Total cost: 108 cents

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago