Answer:
1. Using meaningful names for all variables and functions.
2. Use shorter blocks of codes wherever possible
Explanation:
Their code should be easy to read, this can be achieved by avoiding complex syntax, basically they should adopt the two methods stated in the answer
Answer:
#include<iostream>
using namespace std;
void main()
{
int townA_pop,townB_pop,count_years=1;
double rateA,rateB;
cout<<"please enter the population of town A"<<endl;
cin>>townA_pop;
cout<<"please enter the population of town B"<<endl;
cin>>townB_pop;
cout<<"please enter the grothw rate of town A"<<endl;
cin>>rateA;
cout<<"please enter the grothw rate of town B"<<endl;
cin>>rateB;
while(townA_pop < townB_pop)//IF town A pop is equal or greater than town B it will break
{
townA_pop = townA_pop +( townA_pop * (rateA /100) );
townB_pop = townB_pop +( townB_pop * (rateB /100) );
count_years++;
}
cout<<"after "<<count_years<<" of years the pop of town A will be graeter than or equal To the pop of town B"<<endl;
}
Explanation:
Whats ur choices if there web or world try them
Answer: I'd say (B) Two months
Explanation: Hope its correct and helps, Good luck :)
Answer:
The answer is a. int count =args.length
Explanation:
Which code fragment would correctly identify the number of arguments passed via the command line to a Java application, excluding the name of the class that is being invoked?
a. int count = args.length;
b. int count=0; while (!(args[count].equals(""))) count ++;
c. int count = args.length - 1;
d. int count = 0; while (args[count] != null) count ++;
The answer is a. int count =args.length
args is a string array object, which contains set of all arguments. You can find the number of argument by using args.length.