Answer:
Option b outFile.open("outputData.out");
Explanation:
In C++, there are several classes given to handle output and input of characters to or from files. They are:
- ofstream that write on files
- ifstream that read from files
We can use an object of ofstream to hold the contents that we wish to output to an external file. The general syntax is as follows:
ofstream_obj.open(file_name)
This will create a file with a specific file name and it possesses all the contents from the obstream_obj.
Answer: True
Explanation: Gen/Spec is the known as the general specification standard for the classes.This standard helps in bringing out the peer-to-peer relations of class.
Gen/Spec is used in class diagram because it helps in the display of the access sharing and class specification in the general form for the required instances.Thus, this standard helps in the enhancement of the class diagram and its inheritance. So, the statement given in the question is true.
Answer:
Explanation:
When I think about computers, I can understand about the software and the hardware, we can touch the hardware, but the software don't because is only data stored in the hardware, we can interact with the stored data using the hardware, we can complete a system with data, software, hardware, and people, people try to learn about software because it is better paid than fix a hardware.
Answer:
year = int(input("Enter a year: "))
if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
print(str(year) + " - leap year")
else:
print(str(year) +" - not a leap year")
else:
print(str(year) + " - leap year")
else:
print(str(year) + "- not a leap year")
Explanation:
*The code is in Python.
Ask the user to enter a year
Check if the <u>year mod 4</u> is 0 or not. If it is not 0, then the year is not a leap year. If it is 0 and if the <u>year mod 100</u> is not 0, then the year is a leap year. If the <u>year mod 100</u> is 0, also check if the <u>year mod 400</u> is 0 or not. If it is 0, then the year is a leap year. Otherwise, the year is not a leap year.
Answer:
userInput = input("Please enter a string of words ")
userInput.split ()
for item in userInput.split ():
if item =="darn":
print("Censored")
break
else:
print(userInput)
Explanation:
Using Python programming language, the input function is used to receive the users input and save in a variable userInput
Then the .split method is used to convert the words into a list of words.
Using a for loop, the code checks for the word darn and prints censored if it exists else it prints the userInput