0% found this document useful (0 votes)
9 views

Project

This calculus and analytical geometry project assignment asks students to write a program that takes user input for a domain, checks if it lies within the domain of the function f(x) = (x - 1) / sqrt(x^2 - 2), and displays the corresponding range value or an error message; the document provides instructions on how to complete the problem by breaking it into steps and evaluating the function for each input.

Uploaded by

Awais Bhatti
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Project

This calculus and analytical geometry project assignment asks students to write a program that takes user input for a domain, checks if it lies within the domain of the function f(x) = (x - 1) / sqrt(x^2 - 2), and displays the corresponding range value or an error message; the document provides instructions on how to complete the problem by breaking it into steps and evaluating the function for each input.

Uploaded by

Awais Bhatti
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Calculus and Analytical Geometry

Project

Department: CS & IT Course Instructor: Sidra Siddiqui

Purpose:
This assignment is to teach you how we can set up computers to solve math problems for us by just using
what you have studied in this subject and of course some programming knowledge as well.

What to do:
Write a program that keeps on taking input values from the user until user enters “end” and on each input
it tells if the input value lies in the Domain of the function f(x) = (x - 1) / sqrt (x^2 - 2) and also display the
Range of that Domain. Each input is the Domain to be checked, for example, we have input 3, the program
then checks if this input lies in the Domain of the above function which indeed it does as f(3) = (3 – 1) /
sqrt(3^2 - 2) gives the output of 0.755929 which is the Range of the given input, now display it on the
console output. If the input does not lie in the Domain of the function the program should display the
message saying that it is not in the Domain and continue asking for another input. The program end when
the user inputs the string “end”.

Sample output:

*More on the next page.


How to do it:
Function: A black box that takes input, do some processing and gives the output.

Domain: Possible inputs that can be accepted by the function in order for it to solve the equation and
get the solution.

Range: The number of solutions that are generated by the function using the Domain.

Break down the problem into smaller problems and solve each problem individually. Then combine those
smaller solutions to solve the bigger problem. To help you out in this process I have divided the program
into steps:

1. Take input.
2. If input is “end” then end the program.
3. Consider/Convert the input as the Domain to be checked.
4. Put the domain in the function.
5. If the result is not infinity or NaN.
6. Print the result as the range.
7. If not then display error message.

Help and Instructions:


 You can use any programming language for this assignment.
 For step 6 you can use the isfinite() in the std namespace to check if the answer is finite
value i.e. it is normal, subnormal or zero, but not infinite or NaN. This is for C++.
 You can be as free as you want in this assignment as long as the base requirement is met.
 Do it your own way or follow these given “How to do it” steps, up to you.
 If your program gives the desired output, you’ll get good marks. Efficient, creative and
formatted code is encouraged. Copied and unneeded code is discouraged.
 Do it yourself and you will pass. I can see through the effort and as well as the copied
code.
Some helpful links:
https://wiki.analytica.com/index.php?title=INF,_NAN,_and_NULL_-
_Exception_values&title=INF,_NAN,_and_NULL_-_Exception_values

https://en.cppreference.com/w/cpp/numeric/math/isfinite

You might also like