Question: Using while loop write a void function, f4, to print only positive values of y , where x varies from 2 to 15. The equation
- Using while loop write a void function, f4, to print only positive values of y, where x varies from 2 to 15. The equation is y=-1x(x5-1). Call this function within main().
- Using a loop of your choice, write a void function, f5, with two int parameters. The function will print a sequence of numbers starting with the first parameter, increments by 1, and continues printing until it reaches the second parameter. Call this function in main() with two parameters of your choice.
- Write an int function, f6, with one parameter, that returns the value of the function y=10-2x. Call this function within a loop in main() such that only positive values of f6 are printed. The loop varies from 2 to 20.
- Write a Boolean function, f7, to check if an integer is prime or not. Then use this function in main() to print all the primes between 100 and 150 that end in number 3.
- Write a function, f8, that returns the value of the equation p= 5q3+7q2+4q+4. Then in main(), use f8 to find the values of p when q varies from 15 to 3 Furthermore, using function f7 from question 7, print only the values of q that are primes.
- Write a Boolean function, f9, to check if an integer is divisible by 5, 9, or 13. Then call this function in main() to print those numbers between 50 and 70 that the function f9 returns true.
- Write a void function, f10, that converts KM/hr to Miles/hr. It must print the input KM/hr and also print the calculated Miles/hr. 1 KM/hr = 0.62*Miles/hr. Use this function, f10, within main () to generate a conversion table with KM/hr varying from 50 KM/hr to 120 KM/hr in steps of 10 KM/hr. Output must display the table with header (in main()) as follows: KM/hr Miles/hr
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
