Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Question:
Q1) Write a code that asks the user for a positive integer, computes the square root of that integer, and return the result to the user. The computational error needs to be smaller than 0.01.
1. Get a positive integer 'X' as the input.
2. Start from an initial guess, G.
3. Compute the error = (G^2 - X).
4. If error < 0.01, report the G as the result and stop. If not, go to 5.
5. Update G, G = (G + X/G)/2. Go to 3.
Code Block
//This program computes the square root of a given positive integer and is written by Vahid D on 13/1/13
#include using namespace std; int main() { double G = 10, err; // G is an initial guess and err is the error int X; // input, positive integer cout << "Enter a positive integer: \n"; //ask user to enter a number cin >> X; // get the input err = (G*G - X); // compute the error while ( err > 0.01) // continue updating G till the error is smaller than 0.01 { G = (G + X/G)/2; err = (G*G - X); } cout << "Square root of " << X << " is: " << G << endl; // report the result return 0; }
Motherboard is called as motherboard because in the world all borned creature is directly attached to her mother & after it all the relations makes due to her mother so in the simi
Q. What is Single Program Multiple Data? A general style of writing data parallel programs for MIMD computers is SPMD (single program, multiple data) means all processors execu
Explain how presentation layer helps in establishing and processing data in End to End layers. The idea of the presentation layer is to stand for information to the communicati
Write a script that will first initialize a string variable that will kept x and y coordinates of a point in the form 'x 3.1 y 6.4'. Then, use string manipulating functions to ext
Disadvantages of MPI Performance is restricted by communication network between the nodes It can be harder to debug Needs more programming changes to go from seri
This project is divided to two parts (hardware and software) each with is subtask and consideration was given in all areas in order to meet the target specification. Solutions are
1. Consider the one-time pad encryption scheme to encrypt a 1-bit message m, and assume m is chosen with uniform distribution from message space M={0,1}. Let E1 be the event "messa
Q. Find 9's complement for decimal number? The 9's complement is achieved by subtracting every digit of number from 9 (the highest digit value). Let's assume that we want to si
Discuss in detail Table management Techniques? An Assembler uses the subsequent tables: OPTAB: Operation Code Table consists of mnemonic operation code and machine langua
Your JDBC code may throw the following exception: "The coordinator has rolled back the transaction.No further JDBC access is permitted within this transaction." The WebLogic
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd