Answer:
Explanation:
To write a C program for the above problem:
#include <stdio.h>
int main()
{
// we define the variable to get the annual income
float AnIncome;
// to get the annual income from the user
printf("Enter your annual income here: ");
scanf("%f", &Anincome);
// This is the function to test the annual income
float printIt(x){
//we test the amount inputted now
if (x>= 90000){
printf("Congratulations on your income\n"); // This is the congratulatory message
}
if (x<=0){
// This statement is included to avoid putting zero as annual income
printf("Annual Income cannot be zero or less than zero\n");
}
else{
printf("You WILL make $90,000, if you keep going.\n");
}
}
printIt(AnIncome);
return 0;
}
Attached is the image for a flow chat for the program
Answer:
#include <iostream>
#include<cmath>
using namespace std;
int main()
{
double total = 0;
double check=1;
double ct=0;
double old=1;
while( fabs(total - old) > 0.00005 )
{
old=total;
total=total+check*4.0/(2.0*ct+1);
ct=ct+1;
check=0.0-check;
}
cout<<"Approximate value of pi is "<<total<<endl;
return 0;
}
Explanation:
- Initialize all the necessary variables.
- Run a while loop until the following condition is met.
fabs(total - old) > 0.00005
- Inside the while loop calculate the total value.
- Lastly, display the approximate value of pi.
Answer:
Double-click the header in any one page to go to the editing mode, and then, select the content of the header, see screenshot. Then, press Delete key on keyboard, and then click Close Header and Footer to exit the editing mode, all headers in this current document have been deleted immediately.