Answered step by step
Verified Expert Solution
Link Copied!

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
10.
If the last digit of the number is
5
or more, round up to the next multiple of
10.
If it
s less than
5
,
round down to the previous multiple of
10.
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
10
which will perform the rounding operation.
Here are some examples:
roundSum
(
16
,
17
,
18
)
should return
60 using java script

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Describe the even planning process and explain why it is helpful.

Answered: 1 week ago

Question

Brief the importance of span of control and its concepts.

Answered: 1 week ago

Question

What is meant by decentralisation?

Answered: 1 week ago

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

LO3 Name the seven categories of HR functions.

Answered: 1 week ago