Answer:
The function testInOrder is as follows:
bool testInOrder(){
bool chk= false;
int n1, n2, n3;
cin>>n1;cin>> n2; cin>> n3;
if(n2>=n1 && n3 >= n2){chk = true;}
bool result = inOrder(n1,n2,n3);
if(result == chk){ return true;}
else{return false;}
}
The function testmax is as follows:
bool testmax(){
bool chk = false;
int n1, n2;
cin>>n1; cin>>n2;
int mx = n1;
if(n2>=n1){ mx = n2; }
int returnMax = max(n1,n2);
if(returnMax == mx){ chk = true; }
return chk;
}
The prediction program is as follows:
#include <iostream>
using namespace std;
int main(){
int startSize,numDays;
float aveInc;
cout<<"Start Size: ";
cin>>startSize;
while(startSize<2){
cout<<"The starting number of organisms must be at least 2.";
cin>>startSize; }
cout<<"Average Daily Increase: ";
cin>>aveInc;
while(aveInc<1){
cout<<"The average daily population increase must be a positive value.";
cin>>aveInc; }
cout<<"Number of days: ";
cin>>numDays;
while(numDays<1){
cout<<"The number of days must be at least 1.";
cin>>numDays; }
for(int i = 0;i<numDays;i++){ startSize*=(1 + aveInc); }
cout<<"Predicted Size: "<<startSize;
}
Explanation:
testInOrder
This defines the function
bool testInOrder(){
bool chk= false;
This declares all three variales
int n1, n2, n3;
This gets input for the three variables
cin>>n1; cin>>n2; cin>>n3;
This correctly check if the numbers are in order, the result is saved in chk
if(n2>=n1 && n3 >= n2){chk = true;}
This gets the result from inOrder(), the result is saved in result
bool result = inOrder(n1,n2,n3);
If result and chk are the same, then inOrder() is correct
if(result == chk){ return true;}
If otherwise, then inOrder() is false
else{return false;}
testmax
This defines the function
bool testmax(){
This initializes the returned value to false
bool chk = false;
This declares the two inputs as integer
int n1, n2;
This gets input for the two numbers
cin>>n1; cin>>n2;
This initializes the max of both to n1
int mx = n1;
This correctly calculates the max of n1 and n2
if(n2>=n1){ mx = n2; }
This gets the returned value from the max() function
int returnMax = max(n1,n2);
If returnMax and max are the same, then max() is correct
if(returnMax == mx){ chk = true; }
return chk;
}
Prediction program
This declares all necessary variables
int startSize,numDays; float aveInc;
This gets input for start size
cout<<"Start Size: "; cin>>startSize;
The loop is repeated until the user enters valid input (>=2) for startSize
while(startSize<2){
cout<<"The starting number of organisms must be at least 2.";
cin>>startSize; }
This gets input for average increase
cout<<"Average Daily Increase: "; cin>>aveInc;
The loop is repeated until the user enters valid input (>=1) for aveInc
while(aveInc<1){
cout<<"The average daily population increase must be a positive value.";
cin>>aveInc; }
This gets input for the number of days
cout<<"Number of days: "; cin>>numDays;
The loop is repeated until the user enters valid input (>=1) for numDays
while(numDays<1){
cout<<"The number of days must be at least 1.";
cin>>numDays; }
The following loop calculates the predicted size at the end of numDays days
for(int i = 0;i<numDays;i++){ startSize*=(1 + aveInc); }
This prints the predicted size
cout<<"Predicted Size: "<<startSize;
100 POINTS NEED THIS BEFORE 11:59 TODAY!!!!!!!!!!!!!!!
Answer:ok be how hobrhkihfehgdhdj fuiufiisefif jfkijfjfhhfhfhfhf
Explanation:
how do i give brainliest? if what you say works i'll give de brain
two people have to answer the question and at the bottom of the question you'll see a crown and you just click on that to give them brainliest
Answer:
When Two people answer a question A crown should appear at the bottom where you find the buttons like and rat/e so once you click it the crown will go to the top of the question of the question that you think is the best.
Explanation: