Answer:
Attempts to modify the value of a variable defined const are caught at execution time
Explanation:
The false statement among the options is Attempts to edit the value of a variable defined const are caught at execution time while other options are true.
A const variable should not be modify because the main reason of having a const variable is not to make modifying it possible. If you prefer a variable which you may likely want to modify at some point, then don't just add a const qualifier on it. Furthermore, Any code which modify's a const by force via (pointer) hackery invokes Undefined Behavior
Answer:
#include <iostream>
using namespace std;
class DogLicense{
public:
void SetYear(int yearRegistered);
void CreateLicenseNum(int customID);
int GetLicenseNum() const;
private:
int licenseYear;
int licenseNum;
};
void DogLicense::SetYear(int yearRegistered) {
licenseYear = yearRegistered;
}
void DogLicense::CreateLicenseNum(int customID) {
licenseNum = (100000 * customID) + licenseYear;
}
int DogLicense::GetLicenseNum() const {
return licenseNum;
}
int main() {
DogLicense dog1;
dog1.SetYear(2014);
dog1.CreateLicenseNum(777);
cout << "Dog license: " << dog1.GetLicenseNum() << endl;
return 0;
}
Explanation:
You can see the whole code above, but let me explain the fixed function.
void DogLicense::CreateLicenseNum(int customID) {
licenseNum = (100000 * customID) + licenseYear;
}
The function header is already declared in the class. It takes <em>customID</em> as a parameter. To find out the <em>lisenseNum</em>, we need to apply the given formula <em><u>(100000 * customID) + licenseYear</u></em>.
Answer:
total = 0.0
for x in dictionary.values():
if x == str(x):
total += 1
elif x is bool:
total += 2 if x is True else total -3
else:
total += x
print( total )
Explanation:
The python source code defines a variable 'total' and iterates through a dictionary and adds its values to the total variable. Finally, the total value is printed.
Answer:
Use the combination: Ctrl + Alt + C to get the copyright symbol
Explanation:
<em>Keyboard shortcuts</em> are single or combination of several keys to carry out a specific action. This action may vary according to application programs or operating systems.
Some generic examples of keyboard combinations include:
- Ctrl + C to copy selected objects,
- Ctrl + V to paste copied objects
- Ctrl + N to open a new document or browsing window
- Ctrl + O to open a saved file.
Keyboard shortcuts are a blessing to users for the following reasons:
- Saves time: Imagine dragging a mouse to highlight a document of about 500 pages, what a waste of time right? Ctrl + A will do all that in about a second or two. Using keyboard shortcuts and key combination saves the user a lot of time.
- Efficiency: Since the time spent is greatly reduced, the user becomes more efficient because jobs are carried out faster, more grounds are covered making the user more efficient.
- Multi-tasking: Moving through multiple open windows and tasks with speed requires the use of keyboard shortcuts and combinations. Imagine that you are using a Windows Operating System, you are running an analysis on your browser and it requires you to constantly check it out and you have to finish typing this document on Microsoft Word and you constantly want to ensure that your music player is playing the right song, navigating through this programs using the mouse will just be tiring and may be forced to just stick with a particular application, but with just the Alt + Tab key, you can navigate these applications with ease.
In Office Word 2013, combining the <em>Ctrl + Alt + C</em> will create the copyright symbol in seconds.
Answer:
See explanation
Explanation:
This question seem incomplete as what's required was not stated.
To answer this question, I'll assume it's a fill-in-the-gap question
The definition given above describes computer peripherals.
Peripherals is one of the links between a computer user and the computer itself.
Through peripherals such as keyboards, mouse, light pen , one can send input into the computer.
In the same vein, one can get outputs through peripherals such as the computer monitor, speakers, printers, etc.