Answer:
Hi there Smartcreeper! You can declare structs in C++ to answer this question. Please refer to my explanation below.
Explanation:
A struct in C++ allows us to define a structure with different data types into a single collection. The "emp[30];" at the end of the struct declares an array of the Server structure of size 30. The assignments to different components as required in the question are made and printed out to the console to verify.
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
struct Server {
string manufacturer;
string model;
string serialnum;
int year;
double clockSpeed;
int cores;
int ram;
int storage;
} emp[30];
int main()
{
int k = 5;
int d = 2;
emp[30].storage = 12;
emp[d].manufacturer = 3.50;
emp[k].model = "Hello";
cout << emp[30].storage << endl;
cout << emp[d].manufacturer << endl;
cout << emp[k].model << endl;
}
Answer:
Following are the C++ code
int speed=20; // Store 20 in the speed varaible.
int time=10; //Store 10 in the time variable.
int distance = speed *time; // multiply by speed *time
cout<<distance; // display the value of distance
Explanation:
Following are the program in C++ language :
#include <iostream> // header file
using namespace std; // namespace
int main()
{
int speed=20; // Store 20 in the speed varaible.
int time=10; //Store 10 in the time variable.
int distance = speed *time; // multiply by speed *time
cout<<distance; // display the value of distance
return 0;
}
Output:20
Explanation:
Following are explanation of following code
- Declared a vaiable of type int called "speed" and store 20 on it.
- Declared a vaiable of type int called "time" and store 10 on it.
- multiply by speed into the time and store into the distance variable.
- finally print the "display" value
Answer:
Expression A
Explanation:
In this Pseudocode, the output would be 100. This is because the code is looping from 1 to 20 and adding together all of the odd numbers between 1 and 20. Since it is checking to make sure that the remainder of each number is not equal to 0 which would indicate an odd number, and if it is odd then it adds it to the variable S. Therefore, the odd numbers between 1 and 20 are the following...
1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 + 19 = 100
Answer:
Hi!
It is not possible to have a deadlock involving only one process.
Explanation:
Deadlock is only possible if there are multiple processes trying to access the same shared resources. Another way to see it is if you have shared resources only can be a deadlock if multiple processes attempt to use it.
With only one process, you can use shared resources without the risk of fall into deadlock, but you don't have concurrence either.
Answer:
A=34
Explanation:
Rewrite the equation as 2a−56=3⋅4
2a−56=3⋅4
Multiply 3 by 4
2a−56=12
Move all terms not containing a to the right side of the equation.
2a=68
Divide each term by 2
and simplify.
a=34