<h2>
Answer:</h2><h2>#include <iostream>
</h2><h2>using namespace std;
</h2><h2>
</h2><h2>int main()
</h2><h2>{
</h2><h2> char c;
</h2><h2> int isLowercaseVowel, isUppercaseVowel;
</h2><h2>
</h2><h2> cout << "Enter an alphabet: ";
</h2><h2> cin >> c;
</h2><h2>
</h2><h2> // evaluates to 1 (true) if c is a lowercase vowel
</h2><h2> isLowercaseVowel = (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
</h2><h2>
</h2><h2> // evaluates to 1 (true) if c is an uppercase vowel
</h2><h2> isUppercaseVowel = (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U');
</h2><h2>
</h2><h2> // evaluates to 1 (true) if either isLowercaseVowel or isUppercaseVowel is true
</h2><h2> if (isLowercaseVowel || isUppercaseVowel)
</h2><h2> cout << c << " is a vowel.";
</h2><h2> else
</h2><h2> cout << c << " is a consonant.";
</h2><h2>
</h2><h2> return 0;
</h2><h2>}</h2>
Explanation:
Answer:
#include <stdio.h>
#include <math.h> /* has sin(), abs(), and fabs() */
int main(void) {
double interval;
int i;
for(i = 0; i <30; i++) {
interval = i/10.0;
printf("sin( %.1lf ) = %.3lf \t", interval, abs(sin(interval)));
}
printf("\n+++++++\n");
return 0;
}
Explanation:
The C source code defines a void main program that outputs the absolute value of the sine() function of numbers 0.1 to 3.0.
Answer:
The ping command.
Explanation:
In a network, workstations known as clients, users or nodes are the devices where data is needed or sents from. A server on the other hand, is a device in the network, configured to render a particular service like database, domain name service, web service etc.
When a link from a workstation to a server is down, the workstation looses connection the server. To confirm the connectivity of the link, "ping" the server ip address from the workstation using the command "ping 'server ip address'". This sends echo packets to the server, which is echoed back if there is connectivity.
Answer:
C++.
Explanation:
int main() {
int num_days_scores;
cout<<"How many days of scores? ";
cin<<num_days_scores;
cout<<endl;
///////////////////////////////////////////////////////////////////////////
// Get scores for each day and add it to array
int score = 0;
int* score_array = new int[num_days_scores];
for (int i = 0; i < num_days_scores; i++) {
cout<<Enter score for day "<<i+1<<": ";
cin<<score;
score_array[i] = score;
}
////////////////////////////////////////////////////////////////////////////
// Calculate total of scores by traversing array
int final_score = 0;
for (int i = 0; i < num_days_scores; i++) {
final_score += score_array[i];
}
cout<<"The total score of the "<<num_days_scores<<" days is "<<final_score;
////////////////////////////////////////////////////////////////////////////
delete[] score_array;
return 0;
}