subject

The following pseudocode describes how to extract the dollars and cents from a price given as a floating-point value. For example, a price 2.95 yields values 2 and 95 for the dollars and cents. a. Assign the price to an integer variable dollars.
b. Multiply the difference price - dollars by 100 and add 0.5.
c. Assign the result to an integer variable cents. Translate this pseudocode into a Java program. Read a price and print the dollars and cents. Test your program with inputs 2.95 and 4.35.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
What is the largest decimal number that can be represented by a binary number with 4 place values? (remember, each place in a binary number has a value of a power of 2, starting in the ones place with 20.)
Answers: 3
question
Computers and Technology, 22.06.2019 08:30
Linda subscribes to a cloud service. the service provider hosts the cloud infrastructure and delivers computing resources over the internet.what cloud model is linda using
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
Which action is good business etiquette? a. switching your cell phone off before you enter a meeting b. keeping your cell phone on low volume before you enter a meeting c. setting a pleasant ring tone on your cell phone before you enter a meeting d. setting a standard ringtone on your cell phone before you enter a meeting
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
Ou listened to a song on your computer. did you use hardware or software?
Answers: 2
You know the right answer?
The following pseudocode describes how to extract the dollars and cents from a price given as a floa...
Questions
question
Social Studies, 20.02.2020 20:57
Questions on the website: 13722359