Mid - Semester Quiz
In the following quiz more than one answer may be correct or all of the answers may be wrong.
You have downloaded the file yesterday.txt into your Downloads directory, which is a sub-directory of your home directory, as is the directory exercises.
You want to copy this file into the exercises/solutions/exercise_2
First you do:
cd ~/exercises/solutions/exercise_3
Which of the following commands will copy the file as desired?
cp ~/Downloads/yesterday.txt .
cp $HOME/Downloads/yesterday.txt .
cp $HOME/Downloads/yesterday.txt ..
cp ~/Downloads/yesterday.txt exercises/solutions/exercise_2
cp ~/Downloads/yesterday.txt $HOME/exercises/solutions/exercise_2
cp ~/Downloads/yesterday.txt ~/exercises/solutions/exercise_2
You are the super user and you do:
cd /
rm -rf
This will:
print “permission denied” and do nothing
remove a file named ‘*’
wipe your complete operating system off the disk including all user files
delete all files in the / directory except of directory files and their contents
You type:
ls ~/Downloads > downloads.txt
What will it print?
All the file names in your Download directory
nothing, but it will create an empty file named downloads.txt
nothing, but it will create a file named downloads.txt with all the names of the files in ~/Downloads in it
it will count the number of files you have in your Downloads directory
What does this function do?
It calculates and returns the value of the sin function of an angle, which must be given in degrees (the angle parameter must be a double value in degrees)
It calculates and returns the value of the sin function of an angle, which must be given radians (the angle parameter must be a double value in radians)
It returns an error message
It is simply plain wrong and does not compile
It fails because the main program does not call the add function
It fails because the main program should call the add function with the right variable names num1 and num2 and not val1 and val2
It prints 6.0000 + 7.0000 = 13.0000
If does not compile because the add function must be in a different file
It does not compile because there is no add.h include file
The address of the character ‘H’
The character H, which has the hex value of 0x48
It contains all the characters of the string “Hello World!”
The same value as helloWorld
none of the above
What is gpio?
a General Purpose Input Output pin
the name of a command defined in the wiringPi library
a Generalized Peripheral Interface Option
The Raspberry Pi does not have such a thing
A university shuttle bus taking Uli to the I2C hostel
An industry standard serial bus with only 3 connections:
Vcc
ground
a signal pin
An industry standard bus with 4 connections:
Vcc
ground
a data line (SDA)
a clock line (SCL)
The parallel bus connecting the CPU to memory and/or peripherals
none of the above
It is an April’s joke of a Sygnetics engineer and it is complete nonsense
It is a device that is used to store non-volatile information in a micro-controller chip such as the ARM processor we use on the Raspberry Pi
It is a memory type specially designed for embedded systems
It is a memory type used within sensors
Good luck!
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
png | add.png | r1 | manage | 20.1 K | 2017-11-15 - 16:14 | UnknownUser | |
png | sine.png | r1 | manage | 14.2 K | 2017-11-15 - 16:16 | UnknownUser |