Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:00, 1991987
When a rectangular region is defined using an appropriate style, which value matches the specified edge of the clipping region to the edge of the parent element?
Answers: 3
image
Computers and Technology, 22.06.2019 04:30, safi30360oz0c34
What kind of software users of all skill levels create web pages that include graphics, video, audio, animation, and other special effects? website authoring website software website publishing website editing
Answers: 1
image
Computers and Technology, 22.06.2019 09:40, Tyrant4life
It is vital to research each of the services you plan to disable before implementing any change, especially on critical machines such as the: a. servers in the test environment. b. domain controller and other infrastructure servers. c. desktops that have previously been attacked. d. desktops used by upper-level management.
Answers: 2
image
Computers and Technology, 22.06.2019 15:50, minideeri
The file sales data. xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel. xlsm to find a nice color of gray.)
Answers: 2
Do you know the correct answer?
The following pseudocode describes how to extract the dollars and cents from a price given as a floa...

Questions in other subjects:

Konu
Mathematics, 14.09.2021 23:40