Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The problem is to create a function roundSum which takes three integers as input and returns their sum. However, before adding, each number should be
The problem is to create a function roundSum which takes three integers as input and returns their sum. However, before adding, each number should be rounded to the nearest multiple of
If the last digit of the number is
or more, round up to the next multiple of
If it
s less than
round down to the previous multiple of
The roundSum function should accept three parameters:
a: an integer value.
b: an integer value.
c: an integer value.
Additionally, to avoid repetition, write a helper function round
which will perform the rounding operation.
Here are some examples:
roundSum
should return
using java script
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started