Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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

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

More Books

Students also viewed these Databases questions

Question

2. Compare the sales and service departments at Auto World.

Answered: 1 week ago