Giter Club home page Giter Club logo

dart's Introduction

Dart Exercises

This repository contains exercises for learning Dart.

Exercises

01-Basic

01 - Hello World

The Hello World exercise is a simple program that prints "Hello, World!" to the console.

How to Run

To run an exercise, navigate to its directory and use the dart run command. For example:

cd exercises/01-basic
dart run 01-hello-world.dart

02 - Data Types

The Data Types exercise demonstrates the usage of different data types in Dart. It declares variables of various types and prints their values.

The exercise covers:

  • Numeric types (int and double)
  • Nullable types
  • String interpolation
  • Multiline strings
  • Boolean types
  • Lists and Sets
  • Maps or Dictionaries

In the exercise, you'll also learn how to manipulate lists and sets in Dart. A list of villains is created and then updated by changing the villain at index 0 and adding a new villain at the end. The list is then converted to a set to remove any duplicates, and then converted back to a list.

To run this exercise, use the following commands:

cd exercises/01-basic
dart run 02-datatypes.dart

03 - Final and Const

The Final and Const exercise demonstrates the usage of final and const variables in Dart. It declares final, const, and late final variables, and prints their values. It also shows how to declare final and const lists and the difference between them.

The exercise covers:

  • final variables
  • const variables
  • late final variables
  • final lists
  • const lists

To run this exercise, use the following commands:

cd exercises/01-basic
dart run 03-finalConst.dart

04 - Comments

The Comments exercise demonstrates the usage of different types of comments in Dart. It includes inline comments, multiline comments, and documentation comments.

The exercise covers:

  • Inline comments
  • Multiline comments
  • Documentation comments

To run this exercise, use the following commands:

cd exercises/01-basic
dart run 04-comments.dart

05 - Arithmetic Operators

The Arithmetic Operators exercise demonstrates the usage of different arithmetic operators in Dart. It includes addition, subtraction, multiplication, division, modulus, and increment/decrement operators.

The exercise covers:

  • Addition (+)
  • Subtraction (-)
  • Multiplication (*)
  • Division (/ and ~/)
  • Modulus (%)
  • Increment (++)
  • Decrement (--)
  • Addition assignment (+=)
  • Subtraction assignment (-=)

To run this exercise, use the following commands:

cd exercises/01-basic
dart run 05-operators-arit.dart

06 - Other Operators

The Other Operators exercise demonstrates the usage of different types of operators in Dart, including relational and type test.

The exercise covers:

  • Relational operators (>, <, >=, <=, !=, ==)
  • Type test operators (is, is!)

To run this exercise, use the following commands:

cd exercises/01-basic
dart run 06-operators.dart

02 - Control Structures

01 - Taking Input

The Taking Input exercise demonstrates how to take input from the user in Dart using the stdin.readLineSync() function. It covers:

  • Importing the dart:io library
  • Using the stdin.readLineSync() function to take user input
  • Parsing the input to different data types

To run this exercise, use the following commands:

cd exercises/02-control
dart run 01-take-input.dart

02 - If-Else Statements

The If-Else Statements exercise demonstrates the usage of if-else control structures in Dart. It covers:

  • Using if statements to control the flow of the program
  • Using else statements to provide an alternative path for the program
  • Using else if statements to check multiple conditions

To run this exercise, use the following commands:

cd exercises/02-control
dart run 02-ifelse.dart

02.1 - If-Else Exercise

The If-Else Exercise is a practice exercise for using if-else control structures in Dart. It covers:

  • Using if statements to control the flow of the program
  • Using else statements to provide an alternative path for the program
  • Using else if statements to check multiple conditions

To run this exercise, use the following commands:

cd exercises/02-control
dart run 02-exercise-ifelse.dart

dart's People

Contributors

alejandrodev8 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.