Find 10 syntax errors from the given program. Write the line number and correct statement in...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Find 10 syntax errors from the given program. Write the line number and correct statement in the space provided below. #include <iostream> #include <<math> #include<iomanip> using namespace std; const double pi=35.4; double d (float a; float b;float c); int main() { float a, b, c, x1, x2, discriminant, realpart, imaginaryPart; cin >> a >> b >> c; for (int m=1;m<=10) { discriminant -d(a,b,c); if (discriminant < 0) (x1=int (b + sqrt(discriminant))/(2*a); x2 = (-b elseif (discriminant == 0) {cout << "Roots are real and same." << endl; x1 = -b/(2*a); cout << "x1 = x2 =" <<setw << x1 <<< endl; sqrt(discriminant)) / (2+ -a); } } else { int realPart = -b/(2*a); imaginaryPart =sqrt(-discriminant)/(2^a); } cout<<("Enter coefficients a, b and c: "); cin >> a >> b >> c; } return 0, exit; } double d (float a, float b, float c) { return w= b*b 4*a*c;} Find 10 syntax errors from the given program. Write the line number and correct statement in the space provided below. #include <iostream> #include <<math> #include<iomanip> using namespace std; const double pi=35.4; double d (float a; float b;float c); int main() { float a, b, c, x1, x2, discriminant, realpart, imaginaryPart; cin >> a >> b >> c; for (int m=1;m<=10) { discriminant -d(a,b,c); if (discriminant < 0) (x1=int (b + sqrt(discriminant))/(2*a); x2 = (-b elseif (discriminant == 0) {cout << "Roots are real and same." << endl; x1 = -b/(2*a); cout << "x1 = x2 =" <<setw << x1 <<< endl; sqrt(discriminant)) / (2+ -a); } } else { int realPart = -b/(2*a); imaginaryPart =sqrt(-discriminant)/(2^a); } cout<<("Enter coefficients a, b and c: "); cin >> a >> b >> c; } return 0, exit; } double d (float a, float b, float c) { return w= b*b 4*a*c;}
Expert Answer:
Answer rating: 100% (QA)
There are several syntax errors in the C program Here is the syntax errors with respective corrected ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Prepare a trial balance and what is the total of the debit side? The accounts in the ledger of Monroe Entertainment Co, are listed below. All accounts have $479 Fees Earned 743 Insurance Expense...
-
Warnerwoods Company uses a periodic inventory system. It entered into the following purchases and sales transactions for March. Date Activities Units Acquired at Cost Units Sold at Retail Mar. 1...
-
$1,000 is expected to be received 10 years from now. The present value of this $1,000 future cash flow is: 1: Always greater than $1,000. 2: Greater if the interest rate goes up. 3: Less than $1,000...
-
Use the information for Lockard Company given in BE11-2. (a) Compute 2012 depreciation expense using the double-declining-balance method. (b) Compute 2012 depreciation expense using the...
-
Wire 1, with mass \(0.010 \mathrm{~kg}\) and length \(1.0 \mathrm{~m}\), has a square cross section and is initially at rest on a table. It is connected by flexible leads to a battery and carries a...
-
John Thomas. the owner of Thomas Testing, has done some contract work for insurance companies regarding drunk driving_ To Improve his research capabilities, he recently purchased the Rupple Driving...
-
Kazibwe, a businessman does not maintain a complete set of books for his business transactions. The following is a summary of his cash transactions for the year ended December 31, 2015. Receipts Kshs...
-
Leticia and Yessenia both make lotion and candles. In one week, Leticia can make 8 bottles of lotion or 12 candles, whereas Yessenia can make 12 bottles of lotion or 20 candles. Who has the absolute...
-
A cantilevered beam of length 3 m has a point load of ( 2 * 1 0 0 ) N suspended from the free end and a second point load of ( 2 * 1 0 0 ) N suspended from the mid - point. Find the resultant force...
-
You wake up in a strange room, and you drop a ball from a height of 1 . 9 7 m , and observe that it hits the floor 0 . 4 4 4 s after you drop it . In this case you suspect you are in deep space, far...
-
Two parallel plates are 4 2 cm apart and have a potential difference of ( 8 8 * 1 0 0 ) V between them. Find the field strength and calculate the work needed to move a proton against the field from...
-
Radiation emitted from microwave oven and mobile telephony 1 . can not interact with water molecules in the cells to produce free radicals 2 . interact with the human body in the same way like X -...
-
A girl weighing 510 N jumps from a tree, and her center of mass falls a vertical distance of 1.80 m. Find the impulse necessary to bring her to rest. Over what time interval must the deceleration...
-
You areevaluating two loans for your property. You are looking at purchasing a $400,000 property with a 20% downpayment. You can finance this property with either a 30 year mortgage at a rate of 4%,...
-
A survey of 70 college freshmen asked whether students planned to take biology, chemistry, or physics during their first year. Use the diagram to answer each question. How many of the surveyed...
-
Jim is fired from his job as a waiter and decides to take an extended trip to Europe. After touring Europe for 3 months, Jim returns to look for a new job as a waiter. Are his job-hunting expenses...
-
Indicate, in each of the following situations, the number of exemptions the taxpayers are entitled to claim on their 2012 income tax returns. Number of Exemptions a. Donna, a 20-year-old single...
-
Phil and Linda are 25-year-old newlyweds and file a joint tax return. Linda is covered by a retirement plan at work, but Phil is not. a. Assuming Phil's wages were $27,000 and Linda's wages were...
-
Why do you think we would want to draw these two extra lines onto the handwritten account?
-
Explain how an ABS is structured.
-
Explain how an ABS CDO is structured.
Study smarter with the SolutionInn App