Question: CSCI 14-02 Lab Assignment 3 15 Points-Due 2/21/2019 Problems in computations include mathematical precision (i.e. double, float, long, integer) especially when using mixed mode arithmetic.
CSCI 14-02 Lab Assignment 3 15 Points-Due 2/21/2019 Problems in computations include mathematical precision (i.e. double, float, long, integer) especially when using mixed mode arithmetic. An aspect of using an IF statement is to control what appears to the user. Applications must also provide the data in a "useable" and readable format for the user hence formatting for any currency This application will: 1. Allow the user to enter a dollar amount (i.e.$37.21, $563.44, $.77) 2. Determine the number of Twenty dollar bills (2,000 pennies) b. a. Ten dollar bills (1,000 pennies) c. Five dollar bills (500 pennies) d. One dollar bills (100 pennies) Fifty cent pieces (50 pennies) CV e. f. Quarters (25 pennies) g Dimes (10 pennies) h. Nickels (5 pennies) i. Pennies (I penny) for that dollar amount The dollar amount is a decimal value (double or float). The total number of pennies is a "whole" number (integer or long). Some sort of cast to convert that dollar amount into the number of pennies. Since there may be a loss of precision based on the IDE and operating system used, what is the most "precise" data type used for the dollar amount? The total must be compared against or more units of that denomination? Gi.e. 1 Twenty Dollar bill, 2 Quarters, 1 Nickel, 3 Pennies) How would you pass that remaining total to the next denomination? What arithmetic operation returns an integer remainder? Since we may have NO units of a particular denomination such as zero Ten Dollar Bills or zero quarters, how would you NOT display zero denominations? 3. 4. each currency denomination to determine if there is at zero, one 5. 6. Example $54.53 in pennies is 5453 pennies SO.75 in pennies is 75 pennies 1 Fifty Cent Pieces 1 Quarters 2 Twenty Dollar bills 1 Ten Dollar bills 4 One Dollar bills 1 Fifty Cent Pieces 3 Pennies in $54.53 For the logic, how would you break a dollar amount down into change? Factors affecting precision depends on Version and type of operating system (i.e. Windows vs MAC vs Linux/Unix) deemed "significant" in the number of default decimal positions (i.e. Windows default of double How your CPU and operating system deals with mathematical/arithmetic calculations and what is How "complex" is the actual mathematical/arithmetic calculation itself
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
