Difference: Quiz (1 vs. 3)

Revision 32017-11-16 - uli

Line: 1 to 1
 
META TOPICPARENT name="CourseExercises"

Mid - Semester Quiz

Embedded Systems course

General remarks:

In the following quiz more than one answer may be correct or all of the answers may be wrong.

Linux commands

  1. 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?

Changed:
<
<
  • cp ~/Downloads/yesterday.txt .

  • cp $HOME/Downloads/yesterday.txt .

>
>
  • cp ~/Downloads/yesterday.txt .

  • cp $HOME/Downloads/yesterday.txt .

 
  • cp $HOME/Downloads/yesterday.txt ..

  • cp ~/Downloads/yesterday.txt exercises/solutions/exercise_2

Changed:
<
<
  • cp ~/Downloads/yesterday.txt $HOME/exercises/solutions/exercise_2

  • 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

 
  1. You are the super user and you do:

    cd /
    rm -rf

    This will:

  • print “permission denied” and do nothing

  • remove a file named ‘*’

Changed:
<
<
  • wipe your complete operating system off the disk including all user files

>
>
  • 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

  1. 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

Changed:
<
<
  • nothing, but it will create a file named downloads.txt with all the names of the files in ~/Downloads in it

>
>
  • 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

C programming

Added:
>
>
 
  1. What does this function do?

    sine.png

Changed:
<
<
  • 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 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

Changed:
<
<
  1. Here is an add function and its calling main program in a single file . The file is named “add.c”. What does this program do?

    add.png

>
>
  1. Here is an add function and its calling main program in a single file . The file is named “add.c”. What does this program do?


    add.png

 
  • 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

Changed:
<
<
  • It prints 6.0000 + 7.0000 = 13.0000

>
>
  • It prints 6.0000 + 7.0000 = 13.0000

 
  • If does not compile because the add function must be in a different file

Changed:
<
<
  • It does not compile because there is no add.h include file

Pointers

You declare a pointer in this way:

char *helloWorld=”Hello World!”;

>
>
  • It does not compile because there is no add.h include file

 
Changed:
<
<
char *helloPtr = helloWorld;


>
>
  1. Pointers
    You declare a pointer in this way:

    char *helloWorld=”Hello World!”;
    char *helloPtr = helloWorld;

    What is the value of the helloPtr?
  • 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

 

The Raspberry Pi

  1. What is gpio?

Changed:
<
<
  • a General Purpose Input Output pin

  • the name of a command defined in the wiringPi library

>
>
  • 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

Changed:
<
<
What is the I2C bus?
>
>
  1. What is the I2C bus?
 
  • A university shuttle bus taking Uli to the I2C hostel

  • An industry standard serial bus with only 3 connections:

    • Vcc

    • ground

    • a signal pin

Changed:
<
<
  • An industry standard bus with 4 connections:

>
>
  • An industry standard bus with 4 connections:

 
    • Vcc

    • ground

    • a data line (SDA)

Line: 61 to 67
 

Understanding data sheets

Please read the attached data sheet and find out what the device does

Changed:
<
<
  • It is an April’s joke of a Sygnetics engineer and it is complete nonsense

>
>
  • 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

Changed:
<
<

Good luck!

>
>

Good luck!

Solutions:

The correct answers are highlighted in blue.

  -- Uli Raich - 2017-11-15

Revision 22017-11-16 - uli

Line: 1 to 1
 
META TOPICPARENT name="CourseExercises"

Mid - Semester Quiz

Embedded Systems course

General remarks:

In the following quiz more than one answer may be correct or all of the answers may be wrong.

Linux commands

  1. 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?

Line: 8 to 8
 
  • 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

Changed:
<
<
  1. You are the super user and you do:

    cd /
    rm -rf

    *This will:

>
>
  1. 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

Line: 25 to 25
 
  • It returns an error message

  • It is simply plain wrong and does not compile

Changed:
<
<
  1. Here is an add function and its calling main program in a single file . The file is named “add.c”. What does this program do?

add.png

>
>
  1. Here is an add function and its calling main program in a single file . The file is named “add.c”. What does this program do?

    add.png

 
  • 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

Revision 12017-11-15 - uli

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="CourseExercises"

Mid - Semester Quiz

Embedded Systems course

General remarks:

In the following quiz more than one answer may be correct or all of the answers may be wrong.

Linux commands

  1. 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

  1. 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

  1. 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

C programming

  1. What does this function do?

    sine.png

  • 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

  1. Here is an add function and its calling main program in a single file . The file is named “add.c”. What does this program do?

add.png

  • 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

Pointers

You declare a pointer in this way:

char *helloWorld=”Hello World!”;

char *helloPtr = helloWorld;


The Raspberry Pi

  1. 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

What is the I2C bus?

  • 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

Understanding data sheets

Please read the attached data sheet and find out what the device does

  • 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!

-- Uli Raich - 2017-11-15

Comments

<--/commentPlugin-->

META FILEATTACHMENT attachment="add.png" attr="" comment="" date="1510762463" name="add.png" path="add.png" size="20608" user="uli" version="1"
META FILEATTACHMENT attachment="sine.png" attr="" comment="" date="1510762597" name="sine.png" path="sine.png" size="14498" user="uli" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback