Skip to content

Instantly share code, notes, and snippets.

@ShoaibKakal
Created September 25, 2022 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShoaibKakal/ce7dac6445ad6dc22b9384d8b401f4d5 to your computer and use it in GitHub Desktop.
Save ShoaibKakal/ce7dac6445ad6dc22b9384d8b401f4d5 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
contract Quiz{
struct Question{
string statement;
bool isTrue;
}
Question[] questions;
constructor() payable{
addQuestions();
}
function addQuestions()public payable{
questions.push(Question("Gen. Bajwa is the CEO of Pakistan?", true));
questions.push(Question("Firebase was acquired by google in 2013",false));
questions.push(Question("Bitcoin is an application of Blockchain", true));
questions.push(Question("Smart contract removes intermediaries", true));
}
function getQuestions()public view returns(Question[] memory){
return questions;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment