Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SUBJECT: COMPUTER PROGRAMMING TOPIC: FUNCTIONS in C -I am using a Dev-C++ software compiler. Like this using gotoxy: -main.c -mathv2.c -mathv2.h These are the file

SUBJECT: COMPUTER PROGRAMMING

TOPIC: FUNCTIONS in C

-I am using a Dev-C++ software compiler.

image text in transcribedLike this using gotoxy:

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

-main.c

-mathv2.c

-mathv2.h

These are the file names.

-Please use C language. Thank you so much in advance.

1.) CREATE A FOLDER PROJECT1. YOU WILL SAVE ALL THE PROJECT FILES INSIDE THIS FOLDER. Create a new file in C and save it as "MATHV2.C" (filename) and define the following functions inside: A. function void menuLayout() that will display the qiven layout below: B. DEFINE EACH FUNCTION GIVEN IN THE MATH MENU OPTIONS: 1. void printPrimeNos(int n ) \{ 1 "Factors" are the numbers you multiply to get another number. For instance, the factors of 15 are 3 and 5 , because 35=15. A number that can only be factored as 1 times itself is called "prime". The first few primes are 2,3,5,7,11, and 13. The number 1 is not regarded as a prime, and is usually not included in factorizations, because 1 goes into everything. This function will display all prime numbers from 2 to n. */ \} 2. void factorsNo(int num) \{ I define this function that will display all the factors of a number num. If a number can be expressed as a product of two whole numbers, then the whole numbers are called factors of that number. "Factors" are the numbers you multiply to get another number. For instance, the factors of 15 are 3 and 5 , because 35=15. more examples: The factors of 25 are: 1525 factors of 24 are 1, 2, 4, 8, 12, and 24; and the factors of 64 are 1,2,4,8,16,32, and 64 . So, the factors of 6 are 1,2,3 and 6. *I 3. int highestFactor(int num) \{ I Number that divides into another number exactly. It is also known as a divisor. For example, the factors of 24 are 1, 2, 4, 8, 12, and 24; Highes factor of 24 (excluding itself) : 12 and the factors of 64 are 1,2,4,8,16,32, and 64 . The highest factor of 64 is 32 Define this function that will accept an input parameter num, determines the factors of this num using the function factorsNo(num) and at the end returns the highest factor of num (note: excluding num itself). *I 3 4.int tribonacci(int n ) \{ 1 Tribonacci numbers are the numbers in the following integer sequence: 1,1,1,3,5,9,17,31,57,105,193,355, define this function that will accept a positive value for n (w/c determines the nth tribonacci no. in the series) as input parameter. Example: if n=7, it prints the, The 7th Tribonacci no. =17 Note: Add a function that will print also the fibonacci or tribonacci nos. so that the user can verify if the returned no. in the series is correct */ \} \{ I PARKSIDE'S TRIANGLE PARKSIDE'S TRIANGLE is generated from two numbers -- the size and the seed. The size determines how many rows are in the triangle, and the seed determines the first number in the triangle. For example, here are two PARKSIDE TRIANGLES: Analyze the above examples, discover the rule, and write a program that will generate PARKSIDE'S TRIANGLE given any size N (1-10 only) and any seed S (1-9 only). Test your program by generating PARKSIDE'S TRIANGLE for N=6,S=1 and N=7,S=9. define this function to display the parkside's triangle given the size and seed as input parameters *I C.) CREATE a new file in C and save it as "MATHV2.C" in this file you PLACE ALL THE FUNCTION PROTOTYPES AND Create a function main() that will implement all the functions defined in the file "MATHV2.H" c. Asks from the user the needed data input needed in each function

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

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions

Question

Discuss the importance of positioning in IMC planning.

Answered: 1 week ago