Question

In: Computer Science

With 3-digit rounding after each operation find the value of: a. 0.4 + 0.4 + …...

With 3-digit rounding after each operation find the value of:

a. 0.4 + 0.4 + … + 0.4 + 100 (where the 0.4 is repeated 100 times)

b. 100+0.4 + 0.4 + … + 0.4 (where the 0.4 is repeated 100 times)

c. Find the absolute and relative error in parts a and b.

Solutions

Expert Solution

In both cases we are getting absolute error as zero.

After adding 0.4 100 times we are getting 40

sum=sum+100   140

absolute error=after rounding value-approximation value

                        140-140

                        =0

relative error=(absolute error)/after rounding value i.e,0

see below c code for better understanding.

#include<stdio.h>
#include<math.h>
main()
{
    int i,aerror,rerror,rvalue;
    float pre=0.4,val=100.0;
    float sum=0.0;
    for(i=1;i<=100;i++){
        sum=sum+pre;
        }
    sum=sum+100;
    printf("%f\n",sum);
        rvalue=round(sum);
    printf("%f..%f\n",sum,(float)rvalue);
    aerror=rvalue-sum;
    rerror=aerror/rvalue;
    printf("a problem:%f..%.f",(float)aerror,(float)rerror);

}


Related Solutions

Find the value c such that ?(? < ?) = 0.4
Find the value c such that ?(? < ?) = 0.4
Evaluate the polynomial y= x^3- 5x^2+ 6x + 0.55 at x=.137. Use 3-digit arithmetic with rounding....
Evaluate the polynomial y= x^3- 5x^2+ 6x + 0.55 at x=.137. Use 3-digit arithmetic with rounding. Evaluate the percent relative error. (b) Repeat (a) but express y as y= ((x- 5)x +6)x + 0.55
Find the value of the digit indicated with a question mark . ISBN value 0-321-50230-?
Find the value of the digit indicated with a question mark . ISBN value 0-321-50230-?
Find the 3-bit mantissa floating point representation of the following numbers, both by chopping and rounding,...
Find the 3-bit mantissa floating point representation of the following numbers, both by chopping and rounding, and then calculate the associated respective absolute error and relative error: (a) 11/16 (b) 2.75
1. What is value of X after following operation int X=0x 45; X = X<<3 ;...
1. What is value of X after following operation int X=0x 45; X = X<<3 ; X= What is value of X after following operation int x=0x 40; X = X>>3 ; X= What is value of X after following operation int x=0X FF; X = X & 0x0F; X= What is value of X after following operation int x=0x FF; X = ~X ; X= What is value of X after following operation int X=0x FF; X = X...
[2 pts] Find the present value of an investment that is worth $19,513.75 after earning 3%...
[2 pts] Find the present value of an investment that is worth $19,513.75 after earning 3% simple interest for 5 " years. 2. The table below shows the activity on the credit card statement of Miss Pepper Mills for the month of April. She started the month with a balance of $342.57. Date Activity Location Amount 04/05 Payment Payment $200.00 04/15 Charge Gas $26.37 04/22 Charge Macy’s $105.42 04/25 Charge Starbuck’s $4.24 A. [4 pts]Find the average daily balance. B....
3. GRM/GIM Estimates of Appraised Value. Please go to the seventh decimal place, no intermittent rounding:...
3. GRM/GIM Estimates of Appraised Value. Please go to the seventh decimal place, no intermittent rounding:                                Subject               Comp. 1            Comp. 2             Comp. 3 V & C rates                3%                      3%                    3.6%                    4.1% Units                        195                      190                    195                      205 Average Rent           $910                   $915                  $920                   $925 Selling Price               ?                $16,500,000         $15,900,000      $18,200,000 Calculate either the Gross Rent Multiplier for the Comps: Show the estimated price range from a low value to a high value for the subject property:
Suppose that a check digit is assigned to a four-digit number by appending the remainder after...
Suppose that a check digit is assigned to a four-digit number by appending the remainder after division by 7. If the number 36806 has a single-digit error in the first position, determine the possibilities for the correct number.
Find current stock value of Amazon and ebay . Brief description And brief operation of the...
Find current stock value of Amazon and ebay . Brief description And brief operation of the both company Can you reply fast please ?
If x is a binomial random variable, compute ?(?) for each of the following cases: (a)  ?(?≤1),?=3,?=0.4...
If x is a binomial random variable, compute ?(?) for each of the following cases: (a)  ?(?≤1),?=3,?=0.4 ?(?)= (b)  ?(?>1),?=4,?=0.2 ?(?)= (c)  ?(?<2),?=4,?=0.8 ?(?)= (d)  ?(?≥5),?=8,?=0.6 ?(?)=
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT