subject

In r In this question you will create a simplified cash register.
Use the runif function to generate a float (i. e. with or without the decimal) random number between 1
and 90 (let's call this amount). A customer owes this amount, show the amount to the user. Take the input
from the keyboard for the customer to pay this amount.
Customer will hand you (input) some money in an integer denomination greater than the amount. For
example, if the amount is $44.37, the customer hands you 50 or 60 or 70 greater (up to 100). If the amount
given is the exact amount, then you should tell them that no change is owed. Otherwise, you should
calculate the number of each denomination to give them back in their change. The denominations
available are dollars (1.00), quarters (0.25), dimes (0.10), and nickels (0.05). A penny should be rounded
up to the nearest nickel. Once you have calculated the change you should tell the customer how much
change you have given them.
In order to keep your customer happy, you should always give them the fewest coins possible, do not
simply give them back all their change in nickels. You are expected to use meaningful variable names
and comment any code you feel requires explanation.
Example case:
Random Amount - $44.39
User Gives (keyboard input) - $60
Change = 60 - 44.37 = $15.61
Fewest denomination change is: 15 Dollars, 2 Quarters, 1 Dime, 1 Nickel (the 1 cent is rounded up to
a nickel)
I

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
Type the correct answer in the box. spell all words correctly.what kind of graph or chart does this image represent? the given image represents a (blank).
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
This program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fully below. the program may contain multiple methods, and if using an oo language, should be contained within a single class or object. the program should be designed so that it begins execution when invoked through whichever mechanism is most common for the implementation language. â–ş print out all positive integers from 1 to 100, inclusive and in order. â–ş print messages to standard output, matching the sample output below. â–ş in the output, state whether the each integer is 'odd' or 'even' in the output. â–ş if the number is divisible by three, instead of stating that the number is odd or even, state that the number is 'divisible by three'. â–ş if the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is 'divisible by two and three'. â–ş design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic. sample output the number '1' is odd. the number '2' is even. the number '3' is divisible by three. the number '6' is divisible by two and three.
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words.size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words.size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
You know the right answer?
In r In this question you will create a simplified cash register.
Use the runif function to g...
Questions
question
Mathematics, 04.07.2020 14:01
Questions on the website: 13722363