Wheels should be pointing towards the curb. this is in case your vehicle rolls, if it does, the wheel will hit the curb and stop the car, it will also prevent the car from going into the road and incoming traffic. vice versa when parking uphill, point wheels away from curb, that is also to prevent the car from rolling to incoming traffic.
2**(32 - netmask) - 2 = number of nodes available
The netmask is in CIDR (Common Internet Domain Routing) notation, without the slash.
One of the nodes would be needed for a router or else you can't communicate with other networks.
Answer:
// Program is written in Java Programming Language
// Comments are used for explanatory purpose
// Program starts here
public class RandomOddEve {
/** Main Method */
public static void main(String[] args) {
int[] nums = new int[100]; // Declare an array of 100 integers
// Store the counts of 100 random numbers
for (int i = 1; i <= 100; i++) {
nums[(int)(Math.random() * 10)]++;
}
int odd = 0, even = 0; // declare even and odd variables to 0, respectively
// Both variables will serve a counters
// Check for odd and even numbers
for(int I = 0; I<100; I++)
{
if (nums[I]%2 == 0) {// Even number.
even++;
}
else // Odd number.
{
odd++;
}
}
//.Print Results
System.out.print("Odd number = "+odd);
System.out.print("Even number = "+even);
}
Answer:
/*C++ program that prompts user to enter the name of input file(input.txt in this example) and print the sum of the values in the file to console. If file dosnot exist, then close the program */
//header files
#include <fstream>
#include<string>
#include <iostream>
#include <cstdlib> //needed for exit function
using namespace std;
//function prototype
int fileSum(string filename);
int main()
{
string filename;
cout << "Enter the name of the input file: ";
cin >> filename;
cout << "Sum: " << fileSum(filename) << endl;
system("pause");
return 0;
}
/*The function fileSum that takes the string filename and
count the sum of the values and returns the sum of the values*/
int fileSum(string filename)
{
//Create a ifstream object
ifstream fin;
//Open a file
fin.open(filename);
//Initialize sum to zero
int sum=0;
//Check if file exist
if(!fin)
{
cout<<"File does not exist ."<<endl;
system("pause");
exit(1);
}
else
{
int value;
//read file until end of file exist
while(fin>>value)
{
sum+=value;
}
}
return sum;
}//end of the fileSum
Explanation:
This is a C++ program that prompts user to enter the name of input file(input.txt in this example) and print the sum of the values in the file to console. If file dosnot exist, then close the program.
Check attachment for sample output screenshot.