Skip to content

Amjad Elahi #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions quizapp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/
3 changes: 3 additions & 0 deletions quizapp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

- Initial version.
2 changes: 2 additions & 0 deletions quizapp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.
30 changes: 30 additions & 0 deletions quizapp/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
3 changes: 3 additions & 0 deletions quizapp/bin/exit.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
quit(){
return true;
}
21 changes: 21 additions & 0 deletions quizapp/bin/git.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'dart:io';

git(){
List<String> choices = [
"1- Its a popular version control system\n",
"2- Used for tracking code changes\n",
"3- Used for tracking who made changes\n",
"4- Its a coding collaboration\n",
"5- All of the above\n"
];
print("Choose the number of correct answer\n");
print(choices);
int input = int.parse(stdin.readLineSync()!);
if(input == 5){
print("Correct");
}
else{
print("The answer is number 5");
}
stdin.readLineSync();
}
19 changes: 19 additions & 0 deletions quizapp/bin/git_init.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'dart:io';

gitInit(){
List<String> choices = [
"1- git init\n",
"2- git clone\n",
"3- git push\n"
];
print("Choose the number of correct answer\n");
print(choices);
int input = int.parse(stdin.readLineSync()!);
if(input == 1){
print("Correct");
}
else{
print("The answer is number 1");
}
stdin.readLineSync();
}
19 changes: 19 additions & 0 deletions quizapp/bin/git_push.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'dart:io';

gitPush(){
List<String> choices = [
"1- git init\n",
"2- git clone\n",
"3- git push\n"
];
print("Choose the number of correct answer\n");
print(choices);
int input = int.parse(stdin.readLineSync()!);
if(input == 3){
print("Correct");
}
else{
print("The answer is number 3");
}
stdin.readLineSync();
}
19 changes: 19 additions & 0 deletions quizapp/bin/github.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'dart:io';

gitHub(){
List<String> choices = [
"1- Its a web based interface that uses git\n",
"2- Its an open source version control system\n",
"3- All of the above\n"
];
print("Choose the number of correct answer\n");
print(choices);
int input = int.parse(stdin.readLineSync()!);
if(input == 3){
print("Correct");
}
else{
print("The answer is number 3");
}
stdin.readLineSync();
}
38 changes: 38 additions & 0 deletions quizapp/bin/quizapp.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'git.dart';
import 'dart:io';
import 'exit.dart';
import 'github.dart';
import 'trueorfalse.dart';
import 'git_init.dart';
import 'git_push.dart';
void main(List<String> arguments) {
bool flag = false;
do {
print("\n\n\n");
print("-----please choose a question-----");
print("1: What is git?");
print("2: What is a github?");
print("3: Does git store a seperate copy of every file in every commit?");
print("4: What is the command line of initilizing git?");
print("5: What is the command line for pushing changes to remote repository?");
print("6: exit");
print("---------------------------------------");

int input = int.parse(stdin.readLineSync()!);

switch (input) {
case 1:
git();
case 2:
gitHub();
case 3:
trueOrfalse();
case 4:
gitInit();
case 5:
gitPush();
case 6:
flag = quit();
}
} while (!flag);
}
15 changes: 15 additions & 0 deletions quizapp/bin/trueorfalse.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'dart:io';

trueOrfalse(){
print("Choose the number of correct answer\n");
print("1- True");
print("2- False");
int input = int.parse(stdin.readLineSync()!);
if(input == 2){
print("Correct");
}
else{
print("The answer is number 2");
}
stdin.readLineSync();
}
3 changes: 3 additions & 0 deletions quizapp/lib/quizapp.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int calculate() {
return 6 * 7;
}
Loading