Answer:
one is less advanced and 3rd is more advanced and sometimes has fixed bugs and/or more features
Explanation:
Answer:
The code will display the following on the screen:-
2
0
2
Explanation:
The output is like this because x{2} assigns the value 2 to the integer x.First the value of x is printed on the screen that is 2 and that newline is used to go to the next line.After that function is called doSomething with x passed as the argument. doSomething function assigns the value zero to the variable passed and prints it on the screen.So the next line is 0.Since x is passed by value so no changes will appear in the original argument.Hence the last line printed is 2.
Using the knowledge in computational language in C++ it is possible to write a code that Find the Average of the sum of prime numbers between 1 to any given number
<h3>Writting in C++ code:</h3>
<em />
<em>#include <iostream></em>
<em>using namespace std;</em>
<em>bool isPrime(int n){</em>
<em> for(int i = 2; i < n/2; i++){</em>
<em> if(n%i == 0){</em>
<em> return false;</em>
<em> }</em>
<em> }</em>
<em> return true;</em>
<em>}</em>
<em>int findPrimeSum(int n){</em>
<em> int sumVal = 0;</em>
<em> for(float i = 2; i <= n; i++){</em>
<em> if(isPrime(i))</em>
<em> sumVal += i;</em>
<em> }</em>
<em> return sumVal;</em>
<em>}</em>
<em>int main(){</em>
<em> int n = 15;</em>
<em> cout<<"The sum of prime number between 1 to "<<n<<" is "<<findPrimeSum(n);</em>
<em> return 0;</em>
<em>}</em>
See more about C++ code at brainly.com/question/19705654
#SPJ1
Answer:
public abstract class Vehicle
{
private int id;
public int ID
{
get { return id; }
set { id = value; }
}
private string model;
public string Model
{
get { return model; }
set { model = value; }
}
public abstract string VehicleDetail(int id, string model);
}
public class Car : Vehicle
{
public Car() { }
public Car(int id, string model)
{
ID = id;
Model = model;
}
public override string VehicleDetail(int id, string model)
{
return $"{id} - {model}";
}
}
public class Bus : Vehicle
{
public Bus(int id, string model, string make)
{
ID = id;
Model = model;
Make = make;
}
public string Make { get; set; }
public override string VehicleDetail(int id, string model, string make)
{
return $"{id} - {model}" - {make};
}
}
Explanation: