Answered step by step
Verified Expert Solution
Question
1 Approved Answer
9:55 0 ...xythos.s3.us-east-1.amazonaws.com G CMPSC 3313 Advanced Programming Languages Programming Assignment #1 Due Date: Jan. 27, 2020, 11:59PM Order Checker Bob's Discount Bolts charges the
9:55 0 ...xythos.s3.us-east-1.amazonaws.com G CMPSC 3313 Advanced Programming Languages Programming Assignment #1 Due Date: Jan. 27, 2020, 11:59PM Order Checker Bob's Discount Bolts charges the following prices: 5 cents per bolt 3 cents per nut 1 cent per washer Write a Java program 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 blots, otherwise 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. If there are no errors the program writes out "Order is OK." In all cases the total price in cents of the specified number of items) is written out. For example: Input: Number of bolts: 12 Number of nuts: 8 Number of washers: 24 Output: Check the Order: too few nuts Total cost: 108 Use constants for the unit cost of each item. In other words, declare constants such as final int bolt Price = 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started