Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objective This assignment will reinforce function development and introduce arrays. You will use loops and decision statements. Laboratory Checklist: Review loops Review Arrays Review C/C++
Objective This assignment will reinforce function development and introduce arrays. You will use loops and decision statements. Laboratory Checklist: Review loops Review Arrays Review C/C++ functions Read Problem Specification Create and Test the functions listed in the specification. Submit Assignment to GITHUB Specification: Note: Try create your programs in your github repository folder so you can avoid having to move them. They should be stored in the lab5 folder. Part A: Create and test the following function. Please use the lab5a.cpp or lab5a.cc for the filename. A function that returns the factorial of a number. The factorial of a number is the result of multiplying a sequence of numbers (such as 4 x 3x2x 1 24 is 4 factorial). A factorial of number is indicated using the exclamation point so for the example above the short hand would be 4!. Note: the factorial of one and zero are both one Please write this function using loops and if statements. Please verify that is works up to at least 25 factorial by creating a table of all factorials from 0 to 25. Part B: Create and test the following function. Please use the lab5b.cpp or lab5b.cc for the filename. Create a function that accepts an integer value and returns true if the number is prime. If the value is negative, return false. Please display the first 50 prime numbers to verify that your code works properly
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