reset password
Author Message
Arnav98
Posts: 48
Posted 00:53 Sep 02, 2017 |

For the following part "Write a method that copies an array of doubles, replaces each value with its reciprocal (that is, replaces x with 1/x) and returns the new array", do we have to replace for example 2 with literally "1/2" or the double value that is 0.5 is fine considering both involve completely different logic ?

abubakir
Posts: 14
Posted 01:01 Sep 02, 2017 |

I believe so. That's what I did

Arnav98
Posts: 48
Posted 01:04 Sep 02, 2017 |

You replaced 2 for example with "1/2" ? @Abubakir

abubakir
Posts: 14
Posted 01:07 Sep 02, 2017 |

no, instead of 2 I put the name of the variable where the user inputs numbers

Deanrona
Posts: 21
Posted 03:06 Sep 02, 2017 |

here's an example of how the output should look like,

original: 2.0 1.0 0.5

New: 0.5 1.0 2.0

 

jhurley
Posts: 207
Posted 09:32 Sep 02, 2017 |

the result of the division will be a double.  Use that.