Skip to content

Wambaforestin/dart-on-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

top image

Dart Practice Repository

Welcome to my Dart Practice Repository! This repository is a program based repository that contains questions Dart with solutions .

Note

Before starting your journey as a flutter developer (cross plateform dev.) it's important and advisable to start by leaning the basing principles and advanced concepts of Dart programming.

Prerequisites

Make sure you have Dart SDK installed on your machine. You can download it from Dart SDK.

Questions

Looping

  1. Write a program to calculate the sum of even numbers between 1 and 100 using a loop.
  2. Write a program to calculate the sum of all numbers between two inputted numbers using a loop.
  3. Write a program to generate the first n terms of the Fibonacci sequence using a loop.
  4. Write a program to check if a given number is a palindrome or not using a loop.
  5. write a program to find all leap years between 2020 to 2080 using a loop.
  6. Write a program to find the sum of all prime numbers between two inputted numbers using a loop.
  7. Write a program to check if a given number is a prime number or not using a loop.
  8. Write a program to find the factorial of a given number using a loop.
  9. Write a program to reverse the digits of a given number using a loop.
  10. Write a program to count the number of digits in a given number using a loop.
  11. Write a program to calculate the sum of digits in a given number using a loop.
  12. Write a program to check if a given string is a palindrome or not using a loop.
  13. Write a program to print the sum of the digits of a given number until the sum is a single digit using a loop.
  14. Write a program to find the largest and smallest numbers in an inputted list using a loop.
  15. Write a program to sort an inputted list in ascending order using a loop.
  16. Write a program to find the GCD (Greatest Common Divisor) of two inputted numbers using a loop.
  17. Write a program to find the LCM (Least Common Multiple) of two inputted numbers using a loop.
  18. Write a program to convert a decimal number to binary using a loop.
  19. Write a program to convert a binary number to decimal using a loop.
  20. Write a program to generate a list of all possible combinations of the elements of an inputted list using a loop.

Array

  1. Write a program to find the largest element in an array.
  2. Write a program to find the sum of all elements in an array.
  3. Write a program to find the average of all elements in an array.
  4. Write a program to count the number of even and odd elements in an array.
  5. Write a program to find the second largest element in an array.
  6. Write a program to sort an array in ascending order.
  7. Write a program to sort an array in descending order.
  8. Write a program to reverse an array.
  9. Write a program to find the frequency of an element in an array.
  10. Write a program to remove duplicates from an array.
  11. Write a program to check if two arrays are equal or not.
  12. Write a program to merge two sorted arrays.
  13. Write a program to rotate an array to the left.
  14. Write a program to rotate an array to the right.
  15. Write a program to find the smallest element in an array.
  16. Write a program to check if an array is sorted or not.
  17. Write a program to find the maximum product of any two elements in an array.
  18. Write a program to find the minimum difference between any two elements in an array.
  19. Write a program to find the first missing positive integer in an array.
  20. Write a program to move all negative numbers to the beginning of an array.
  21. Write a program to move all zeros to the end of an array.
  22. Write a program to find the largest sum subarray in an array.
  23. Write a program to find the smallest sum subarray in an array.
  24. Write a program to find the maximum difference between any two elements in an array.
  25. Write a program to find the minimum difference between any two elements in two arrays.
  26. Write a program to perform CRUD operations on a given array using menu-driven program.

OOP (Beginner level)

  1. Create a class for a calculator with properties such as current value and operation, and methods such as add and subtract.
  2. Create a class for a bank account with properties such as account number, balance, and owner.
  3. Create a class for a person with properties such as name, age, and address.
  4. Create a class for a car with properties such as make, model, and year.
  5. Create a class for a circle with properties such as radius, diameter, and area.
  6. Create a class for a rectangle with properties such as width, height, and area.
  7. Create a class for a student with properties such as name, age, and grades.
  8. Create a class for a book with properties such as title, author, and publisher.
  9. Create a class for a date with properties such as day, month, and year.
  10. Create a class for a bank with properties such as name and location, and methods such as deposit and withdraw.
  11. Create a class for a shopping cart with properties such as items and total cost, and methods such as add item and remove item.
  12. Create a class for a weather forecast with properties such as temperature and conditions.
  13. Create a class for a restaurant with properties such as menu items and prices, and methods such as order and pay.
  14. Create a class for a movie with properties such as title, director, and actors.
  15. Create a class for a playlist with properties such as songs and artists, and methods such as play and shuffle.
  16. Create a class for a bank loan with properties such as amount, interest rate, and duration, and methods such as calculate interest and repay.
  17. Create a class for a grocery list with properties such as items and quantities, and methods such as add and remove.
  18. Create a class for a location with properties such as latitude and longitude, and methods such as find distance and direction.
  19. Create a class for a timer with properties such as duration and current time, and methods such as start and stop.
  20. Create a class for a stopwatch with properties such as start time and end time, and methods such as start and stop.
  21. Create a class for a timer that runs in the background and sends notifications when it's done.
  22. Create a class for a chat app with properties such as messages and users, and methods such as send message and add user.
  23. Create a class for a fitness tracker with properties such as workouts and calories burned, and methods such as log workout and calculate calories.
  24. Create a class for a recipe with properties such as ingredients and instructions, and methods such as add ingredient and cook.
  25. Create a class for a budget with properties such as income and expenses, and methods such as add expense and calculate balance.
  26. Create a class for a game with properties such as score and level, and methods such as play and quit.
  27. Create a class for a to-do list with properties such as tasks and deadlines, and methods such as add task and mark complete.
  28. Create a class for a calendar with properties such as events and dates, and methods such as add event and remove event.
  29. Create a class for a timer that runs a specific action when it's done.
  30. Create a class for a leaderboard with properties such as players and scores, and methods such as add player and update score.

OOP (Intermediate level)

  1. Create a class for a vehicle with properties such as make, model, and year, and methods such as accelerate and brake.
  2. Create a class for a bank with properties such as accounts and loans, and methods such as open account and approve loan.
  3. Create a class for a user with properties such as name, email, and password, and methods such as login and logout.
  4. Create a class for a game character with properties such as health, inventory, and skills, and methods such as attack and defend.
  5. Create a class for a shopping cart with properties such as items and prices, and methods such as checkout and apply discount.
  6. Create a class for a music player with properties such as playlist and volume, and methods such as play and pause.
  7. Create a class for a ticket booking system with properties such as seats and prices, and methods such as reserve and cancel.
  8. Create a class for a restaurant with properties such as menu items and orders, and methods such as place order and calculate bill.
  9. Create a class for a library with properties such as books and borrowers, and methods such as lend book and return book.
  10. Create a class for a file manager with properties such as files and folders, and methods such as create file and delete file.
  11. Create a class for a bank account with properties such as account number, balance, and interest rate, and methods such as deposit and withdraw.
  12. Create a class for a game with properties such as score and level, and methods such as play and save progress.
  13. Create a class for a vehicle rental system with properties such as vehicles and rental rates, and methods such as rent and return.
  14. Create a class for a social media platform with properties such as users and posts, and methods such as create post and like post.
  15. Create a class for a calendar with properties such as events and reminders, and methods such as add event and set reminder.
  16. Create a class for a weather app with properties such as location and temperature, and methods such as update location and display forecast.
  17. Create a class for a messaging app with properties such as conversations and messages, and methods such as send message and delete conversation.
  18. Create a class for a recipe book with properties such as recipes and ingredients, and methods such as add recipe and search recipe.
  19. Create a class for a blog with properties such as posts and comments, and methods such as create post and moderate comments.
  20. Create a class for a game engine with properties such as scene and objects, and methods such as update and render.
  21. Create a class for a stock trading system with properties such as stocks and prices, and methods such as buy stock and sell stock.
  22. Create a class for a hotel reservation system with properties such as rooms and prices, and methods such as book room and cancel reservation.
  23. Create a class for a quiz app with properties such as questions and answers, and methods such as take quiz and grade quiz.
  24. Create a class for a movie theater with properties such as movies and showtimes, and methods such as buy ticket and check availability.
  25. Create a class for a music streaming service with properties such as songs and artists, and methods such as search and play.
  26. Create a class for a game lobby with properties such as players and matches, and methods such as join match and leave match.
  27. Create a class for a ride-sharing app with properties such as drivers and passengers, and methods such as request ride and rate driver.
  28. Create a class for a task manager with properties such as tasks and deadlines, and methods such as add task and mark complete.

OOP (Advance level)

  1. Create a class for a genetic programming system with properties such as population and fitness function, and methods such as select, mutate, and crossover.
  2. Create a class for a quantum computer with properties such as qubits and gates, and methods such as apply gate and measure.
  3. Create a class for a computer vision system with properties such as images and filters, and methods such as detect edges and recognize objects.
  4. Create a class for a natural language processing system with properties such as text and models, and methods such as tokenize and parse.
  5. Create a class for a reinforcement learning system with properties such as environment and agent, and methods such as observe and learn.
  6. Create a class for a distributed computing system with properties such as nodes and messages, and methods such as send and receive.
  7. Create a class for a compiler with properties such as source code and target code, and methods such as parse and optimize.
  8. Create a class for a quantum cryptography system with properties such as qubits and keys, and methods such as encode and decode.
  9. Create a class for a game engine with properties such as entities and components, and methods such as update and render.
  10. Create a class for a physics simulation system with properties such as objects and forces, and methods such as integrate and resolve constraints.
  11. Create a class for a data structure library with properties such as arrays and trees, and methods such as insert and search.
  12. Create a class for a computer algebra system with properties such as expressions and variables, and methods such as simplify and solve.
  13. Create a class for a quantum field theory simulator with properties such as particles and fields, and methods such as evolve and calculate observables.
  14. Create a class for a real-time operating system with properties such as tasks and interrupts, and methods such as schedule and dispatch.
  15. Create a class for a robotics control system with properties such as sensors and actuators, and methods such as sense and act.
  16. Create a class for a compiler optimization system with properties such as intermediate code and optimized code, and methods such as analyze and transform.
  17. Create a class for a molecular dynamics simulation system with properties such as particles and potentials, and methods such as integrate and calculate thermodynamic properties.
  18. Create a class for a computer graphics library with properties such as vertices and shaders, and methods such as draw and rasterize.
  19. Create a class for a parallel computing system with properties such as threads and synchronization primitives, and methods such as spawn and join.
  20. Create a class for a quantum error correction system with properties such as qubits and error syndromes, and methods such as detect and correct.
  21. Create a class for a natural language generation system with properties such as templates and rules, and methods such as generate and render.
  22. Create a class for a computer vision library with properties such as images and features, and methods such as detect and track.
  23. Create a class for a distributed database system with properties such as nodes and data partitions, and methods such as replicate and query.
  24. Create a class for a quantum Monte Carlo simulation system with properties such as particles and wavefunctions, and methods such as sample and estimate observables.
  25. Create a class for a high-performance computing system with properties such as processors and memory, and methods such as parallelize and optimize.

Advance Concepts (HTML Document Object Model and Dart Programming)

  1. How can you dynamically create an HTML element in Dart and append it to the DOM?
  2. Write a Dart function to toggle the visibility of an HTML element based on its ID.
  3. Implement a Dart program to fetch data from an API and dynamically display it on an HTML page.
  4. Create a Dart program to validate a form input and display error messages dynamically on the HTML page.
  5. Write a Dart function to add a CSS class to an HTML element based on user interaction.
  6. Develop a Dart program to create a simple slideshow using HTML images and buttons for navigation.
  7. Implement a Dart function to handle a click event on an HTML button and update the content of a div element dynamically.
  8. Write a Dart program to create a responsive navigation menu using HTML and CSS, and toggle its visibility using Dart.
  9. Develop a Dart function to fetch JSON data from a file or API and dynamically generate HTML elements to display the data in a table format.
  10. Create a Dart program to implement drag-and-drop functionality for HTML elements within a container.

More on Dart/HTML

  1. Write a Dart program that selects an HTML element by its ID and changes its text content.
  2. Create a Dart function that takes a color name as a parameter and changes the background color of the body element in an HTML page.
  3. Write a Dart program that creates a new div element, sets its id, adds some text content, and appends it to the DOM.
  4. Develop a Dart application that listens for click events on a button and displays an alert with a message when the button is clicked.
  5. Implement a Dart class that represents a custom HTML element, including properties and methods to manipulate its appearance and behavior.
  6. Create a Dart program that uses query selectors to find all elements with a specific class and changes their style properties.
  7. Write a Dart script that dynamically creates a table with rows and columns based on data provided by the user.
  8. Develop a Dart web application that fetches JSON data from a server and displays it in a formatted way on the webpage.
  9. Implement a Dart program that uses drag-and-drop API to allow users to drag items from one list to another on a webpage.
  10. Create a complex Dart web application that includes form validation, local storage interaction, and server communication.

These practical questions cover various aspects of using Dart with HTML DOM manipulation and provide opportunities to practice real-world scenarios.

NOTE

1.You can also bring some of this questions to life using Dart and flutter after successfully learning Flutter.

2.Always remember to code following the SOLID principles for cleaner and more maintainable code

Additional Resources

  1. Dart Documentation
  2. Dart Tutorials on YouTube

About

learning journey , Practice - Dart Programming

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published