ExamGecko
Home Home / Blockchain / CBDE

Blockchain CBDE Practice Test - Questions Answers, Page 5

Question list
Search
Search

Solidity files:

A.
can't be split across multiple files, everything should be in one single file.
A.
can't be split across multiple files, everything should be in one single file.
Answers
B.
can be split across multiple files, but every contract must be in a file with the same name as the contract itself.
B.
can be split across multiple files, but every contract must be in a file with the same name as the contract itself.
Answers
C.
can be spread across multiple files. To import all contract from a file you can use "import 'myfile.sol'. To import Contract MyContract from myfile.sol you use "import {MyContract as SomeContract} from 'myfile.sol';".
C.
can be spread across multiple files. To import all contract from a file you can use "import 'myfile.sol'. To import Contract MyContract from myfile.sol you use "import {MyContract as SomeContract} from 'myfile.sol';".
Answers
Suggested answer: C

Files can be imported:

A.
using relative and absolute paths, where the "." And the ".." depict that it's a relative path.
A.
using relative and absolute paths, where the "." And the ".." depict that it's a relative path.
Answers
B.
only via GitHub using the Repository and Username.
B.
only via GitHub using the Repository and Username.
Answers
C.
using the special requirefile(...) statement, which looks in a specific library path to import files.
C.
using the special requirefile(...) statement, which looks in a specific library path to import files.
Answers
Suggested answer: A

Importing from GitHub:

A.
works across all compilers and platforms the same way.
A.
works across all compilers and platforms the same way.
Answers
B.
is generally possible, but currently works only in Remix, but doesn't work in Truffle.
B.
is generally possible, but currently works only in Remix, but doesn't work in Truffle.
Answers
Suggested answer: B

Single line comments in Solidity are:

A.
working with either // or ///
A.
working with either // or ///
Answers
B.
working with /* comment */ or /** @.. natspec style */
B.
working with /* comment */ or /** @.. natspec style */
Answers
C.
not possible, all comments must be multi-line.
C.
not possible, all comments must be multi-line.
Answers
Suggested answer: A

Multi-Line Comments in Solidity are:

A.
working with either // or ///
A.
working with either // or ///
Answers
B.
working with /* comment */ or /** @.. natspec style */
B.
working with /* comment */ or /** @.. natspec style */
Answers
C.
not possible, all comments must be single-line.
C.
not possible, all comments must be single-line.
Answers
Suggested answer: B

The following are value types in Solidity.

A.
Integer, Boolean, Struct, Mapping and Enum.
A.
Integer, Boolean, Struct, Mapping and Enum.
Answers
B.
Integer, Boolean, Enum and Addresses.
B.
Integer, Boolean, Enum and Addresses.
Answers
C.
Integer, Boolean, Structs and Fixed Point Numbers.
C.
Integer, Boolean, Structs and Fixed Point Numbers.
Answers
Suggested answer: B

To compare a String in Solidity you use:

A.
string1 == string2
A.
string1 == string2
Answers
B.
the internal function "str_compare(str1,str2)"
B.
the internal function "str_compare(str1,str2)"
Answers
C.
you can't directly compare two strings, but one method would be to hash both strings and compare the hashes.
C.
you can't directly compare two strings, but one method would be to hash both strings and compare the hashes.
Answers
D.
bytes32(string1) == bytes32(string2)
D.
bytes32(string1) == bytes32(string2)
Answers
Suggested answer: C

If we divide two integers:

5/2, the result is:

A.
2, because the decimal is truncated.
A.
2, because the decimal is truncated.
Answers
B.
3, because it's always rounded.
B.
3, because it's always rounded.
Answers
C.
2.5, because it's automatically converted into a float.
C.
2.5, because it's automatically converted into a float.
Answers
Suggested answer: A

A

Struct is a great way:

A.
to define a new datatype in Solidity, so you don't need to use objects of another contract.
A.
to define a new datatype in Solidity, so you don't need to use objects of another contract.
Answers
B.
to hold instances of other contracts.
B.
to hold instances of other contracts.
Answers
C.
to implement pointers to other contracts that can hold new datatypes.
C.
to implement pointers to other contracts that can hold new datatypes.
Answers
Suggested answer: A

A Mapping consists of keys and value.

A.
the Keys can be anything, but the value can't be another mapping or struct.
A.
the Keys can be anything, but the value can't be another mapping or struct.
Answers
B.
the Value can be anything, but the key cannot be another mapping, struct, integer or Boolean.
B.
the Value can be anything, but the key cannot be another mapping, struct, integer or Boolean.
Answers
C.
the value can be anything, but the key cannot be another mapping, struct, enum or dynamically sized array.
C.
the value can be anything, but the key cannot be another mapping, struct, enum or dynamically sized array.
Answers
Suggested answer: C
Total 102 questions
Go to page: of 11