Giter VIP home page Giter VIP logo

dart-tutorials's Introduction

Assignments

Assignment 1

You need to make a recursive login system that will ask for a username and password. If the username and password are correct, the program will print "Welcome to the system" and will end. If the username and password are incorrect, the program will ask for the username and password again. The program will ask for the username and password 3 times. If the username and password are incorrect 3 times, the program will print "Access denied" and will end. The username and password are "admin" and "1234" respectively.

Sample Output

Enter username: admin
Enter password: 4321
Access denied

Enter username: admin
Enter password: 1234
Welcome to the system

Assignment 2

You need to make a program that will ask for a number and will print the factorial of that number. For example, if the number is 5, the program will print 120. If the number is 0, the program will print 1. If the number is negative, the program will print "Invalid number". The program will ask for a number 3 times. If the number is invalid 3 times, the program will print "Invalid number" and will end.
Note: Use recursion and functions.

Factorial

Factorial is a mathematical operation that multiplies a number by all the numbers below it. For example, 5 factorial is 5 _ 4 _ 3 _ 2 _ 1 = 120. 0 factorial is 1. Negative numbers don't have a factorial.

Sample Output

Enter a number: 5
120

Assignment 3

Concepts: Use Exception Handling and Asynchronous Programming for Input Validation of an email address. You need to make a program that will ask for an email address and will print "Valid email address" if the email address is valid and will print "Invalid email address" if the email address is invalid. The program will ask for an email address 3 times. If the email address is invalid 3 times, the program will print "Invalid email address" and will end.
Note: Use exception handling and asynchronous programming.

Valid Email Address

Regex for valid email address:

^[a-zA-Z0-9.]+@[a-zA-Z0-9]*+\.[a-zA-Z0-9]*$

Sample Output

Enter email address: abccompany.com
Invalid email address

Enter email address: [email protected]
Valid email address

Assignment 4

Write program that asks student for total marks and marks obtained in 5 subjects. Calculate the percentage and grade according to the following table:

Percentage Grade
90-100 A
80-89 B
70-79 C
60-69 D
50-59 E
0-49 F

Sample Output

Enter total marks: 500
Enter marks obtained in subject 1: 87
Enter marks obtained in subject 2: 45
Enter marks obtained in subject 3: 65
Enter marks obtained in subject 4: 76
Enter marks obtained in subject 5: 87

Grade Subject 1: 87 (B)
Grade Subject 2: 45 (F)
Grade Subject 3: 65 (D)
Grade Subject 4: 76 (C)
Grade Subject 5: 87 (B)

Overall Percentage: 72.0
Overall Grade: C

Assignment 5

Write a program that will ask for a number and will print the Fibonacci sequence of that number. For example, if the number is 5, the program will print 0, 1, 1, 2, 3. If the number is 0, the program will print 0. If the number is negative, the program will print "Invalid number". The program will ask for a number 3 times. If the number is invalid 3 times, the program will print "Invalid number" and will end.
Note: Use recursion and functions.

Fibonacci Sequence

The Fibonacci sequence is a sequence of numbers where the next number is the sum of the previous two numbers. For example, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987 and so on...

Sample Output

Enter a number: 5
0, 1, 1, 2, 3

dart-tutorials's People

Contributors

usamasarwar avatar

Stargazers

 avatar  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.