Question: Problem 1 Write a program that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25

Problem 1 Write a program that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25 cents and a dollar, and the machine accepts only a single dollar bill to pay for the item. For example, a possible dialog with the user might be Enter price of item (from 25 cents to a dollar): 45 You bought an item for 45 cents and gave me a dollar, so your change is 2 quarters, O dimes, and 1 nickel. Problem 2: Write a program that reads a 4-bit binary number from the keyboard as a string and then converts it into decimal. For example, if the input is 1100, the output should be 12. (Hint Break the string into substrings and then convert each substring to a value for a single bit. If the the bits are bo, b1,b2, and b3, the decimal equivalent is 8b0 + 461 +262 +63) Problem 3: Write a program named CountPhrase.java that accepts two strings from Cmd argument list, the first one is a file name. Your program should count how many words in the file end with the second argument. For example, if you pass the following two strings to the main method: data.txt ed Your program should check the number of words in the data.txt end with "ed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
