Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can you please give me the pre-condition, post-condition, and the process of thi

ID: 3675919 • Letter: C

Question

Can you please give me the pre-condition, post-condition, and the process of this program?

//Chapter 4 Logical operators

  

#include <iostream>

#include <iomanip>

using namespace std;

  

int main()

{

bool found = true;

int age = 20;

double hours = 45.30;

double overTime = 15.00;

int count = 20;

char ch = 'B';

cout << fixed << showpoint << setprecision(2);

cout << "found = " << found << ", age = " << age

   << ", hours = " << hours << ", overTime = " << overTime

   << "," << endl << "count = " << count

   << ", ch = " << ch << endl << endl;

cout << "!found evaluates to " << !found << endl;

cout << "hours > 40.00 evaluates to " << (hours > 40.00) << endl;

cout << "!age evaluates to " << !age << endl;

cout << "(!found && (age >= 18)) evaluates to "

   << (!found && (age >= 18)) << endl;

cout << "!(found && (age >= 18)) evaluates to "

   << (!(found && (age >= 18))) << endl;

cout << "hours + overTime <= 75.00 evaluates to "

   << (hours + overTime <= 75.00) << endl;

cout << "(count >= 0) && (count <= 100) evaluates to "

   << ((count >= 0) && (count <= 100)) << endl;

cout << "('A' <= ch && ch <= 'Z') evaluates to "

   << ('A' <= ch && ch <= 'Z') << endl;

return 0;

}

Explanation / Answer

Set decimal precision

Sets the decimal precision to be used to format floating-point values on output operations.

Behaves as if member precision were called with n as argument on the stream on which it is inserted/extracted as a manipulator (it can be inserted/extracted on input streams or output streams).

This manipulator is declared in header <iomanip>

per-condition:

found =1, age =20.00, hours =45.30, overTime=15.00,

count =20.00, ch = B

post-condition: