ExamGecko

Blockchain CBDE Practice Test - Questions Answers, Page 5

Question list
Search
Search

Question 41

Report
Export
Collapse

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
asked 16/09/2024
Noor Amy
35 questions

Question 42

Report
Export
Collapse

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
asked 16/09/2024
Massimo Cerqui
38 questions

Question 43

Report
Export
Collapse

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
asked 16/09/2024
Shan Panikker
28 questions

Question 44

Report
Export
Collapse

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
asked 16/09/2024
carlos salgado
40 questions

Question 45

Report
Export
Collapse

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
asked 16/09/2024
Aidan Lear
49 questions

Question 46

Report
Export
Collapse

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
asked 16/09/2024
Spandana Gangavaram
30 questions

Question 47

Report
Export
Collapse

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
asked 16/09/2024
Brad Jarrett
42 questions

Question 48

Report
Export
Collapse

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
asked 16/09/2024
Andrew Kavanagh
37 questions

Question 49

Report
Export
Collapse

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
asked 16/09/2024
Francesco Balducci
36 questions

Question 50

Report
Export
Collapse

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
asked 16/09/2024
David Hartnett
45 questions
Total 102 questions
Go to page: of 11