Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ A) Create a function with the declaration long Factorial(long num); The function should calculate the factorial of the given value and return the value

C++

A) Create a function with the declaration long Factorial(long num); The function should calculate the factorial of the given value and return the value Print out the given number and the calculated factorial Test with 5 values that are entered by the user of the program

B) Create a function: int IsPalidrome(long value ); In that function, determine if the given values digits are a palindrome Examples: 1234321, 1111, 44, 5 are all palindromes Return 1 from the function if the value is a palindrome; 0 otherwise.

Print out the given number and if it is a palindrome or not. Test your function with 5 different values entered by the user

C) Create a function: int HighestBitSet( int value ); In the function determine the position of the highest bit that is set (0 index) Print out the value as a decimal value, in binary and the highest bit set Example: Value = 9 Binary = 1001 Highest bit set = 3 Test your function with 5 different values entered by the user

D) Create a function: void ReverseIt( void ) In the function, input 5 floating point values. Print them out in reverse order to that in which they were entered Save the values to a file first in the order they were entered and in reverse order

E) Create a function: void ReverseItAgain( void ) This function should open the file that was saved in (D), read the values and prints them all out.

F) Create a function: void Pyramid( int lines ) This function should print to the both the screen and to a file a pyramid of * Example: lines = 5 * *** ***** ******* ********* Take the number of lines as input from the user. Test with various values for lines

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 Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions