GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

Programming Chapter 1-4 Test

Liam Blake 30 Fragen

Quiz starten

Dieses Quiz hat ein Zeitlimit und öffnet sich deshalb im gewohnten Player.

Fragen in diesem Quiz (30)

  1. 1Which of the following is the correct way to declare comments?
    1. A//
    2. B#
    3. C/*?
    4. D/*.
  2. 2Which preprocessor directive is needed to perform the cout/cin commands in C++ (assume we are using namespace std)
    1. A#include <stddlib.h>
    2. B#include <stdio.h>
    3. C#include <iostream>
    4. D#include <namespace>
  3. 3Why are semicolons used in C++ and more modern version of C?
    1. ASemicolons make code cleaner
    2. BSemicolons are used to mark the beginning and end of a function, similar to python
    3. CSemicolons are only needed in Object oriented programming
    4. DSemicolons are used to mark the end a command
  4. 4Which of the following are valid ways to declare a variable in C++? (this is a MULTIPLE answered question, select all that apply)
    1. Aint x = 5;
    2. Bint y = 3, 4;
    3. Cint[] x = {3, 3};
    4. Dint x, y = 3;
    5. Eint z = 4
  5. 5Which of the following is a valid way to get the total size of a datatype integer?
    1. Aint size = sizeof(char);
    2. Bint size = size(int);
    3. Cint size = sizeof(int);
    4. Dint size = sizeof(std::uint16_);
  6. 6Whats wrong with this program?
    int Main(int argc, char* argv[])
    {
    return 0;
    }
    1. AReturn 0 must have an indent
    2. BThe parameters passed are invalid
    3. CThe main function cannot be capitalized
    4. DAll of the above are correct
  7. 7Which of the following is the right way to declare a character?
    1. Achar 12char = 'A';
    2. Bchar char12 = ' ';
    3. Cchar char12 = "A";
    4. Dchar 12char = "5";
  8. 8Whats wrong with this function?
    void getArea(int w, int h){
    return w * h;
    }
    1. AA. The curly bracket has to be declared on a seperate line
    2. BB. Returned values are not allowed for a return type 'void'
    3. CC. getArea() has to return an integer
    4. DD. A and C are correct
    5. EE. B and C are correct
    6. FF. A, B, and C are correct
  9. 9What is a double data type short for?
    1. ADouble precision of a 4 byte integer
    2. BDouble data
    3. CDouble precision of a floating point type
    4. DDouble is not a short form for anything
  10. 10Which of the following is not a built in data type?
    1. Aint
    2. Bunion
    3. Cwide character
    4. Dvoid

Informationen

Beschreibung
Grade 12 Introduction to Programming Quiz am Programming Chapter 1-4 Test, erstellt von Liam Blake am 07/10/2021.
Sprache
English
Aufrufe
0
Schlagwörter
introduction to programminggrade 12
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Mehr zu C++ Programming Basics

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck