Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

plz. i don't have much time. thank you. Question 2 The factorial of a positive integer, n, denoted by nl, is the product of all

plz. i don't have much time. thank you. image text in transcribed
Question 2 The factorial of a positive integer, n, denoted by nl, is the product of all positive integers less than or equal to n, i.e. n! = nx (n-1) (n - 2) (n - 3) .... x 3 x 2 x 1. For example: 51 = 5x (5 - 1)* ( 5 - 2) (5 - 3) (5 - 4) = 5 x 4 x 3 x 2 x 1 = 120 Using a while loop control structure, write your own function called my factorial to compute the factorial value for any given integer, n. Your code must: be preceded by the pseudocode only use the R base library (no external packages) consist of appropriate control structure(s) provide correctly defined function(s) be fully commented run without error [TOTAL 10 MARKS]

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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

Explain the market segmentation.

Answered: 1 week ago

Question

Mention the bases on which consumer market can be segmented.

Answered: 1 week ago