This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
daletoRetire(18, 54); | |
String reminder = 'Boss abeg double your hustle'; | |
print(reminder); | |
} | |
void daletoRetire(int currAge, int retAge) { | |
// A year has 365 days in it | |
int ageLeft = retAge - currAge; | |
int ans = ageLeft * 365; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
void main() { | |
var ans = demo(5, 2, 4, 6); //expected ans is 10 | |
// expected ans is 81, uncomment to test | |
// var ans demo(4, 3, 9, 27); | |
print(ans.runtimeType); // for debugging | |
print(ans); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(); | |
// Stateless Widget | |
class BallPage extends StatelessWidget { | |
const BallPage({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatefulWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override | |
State<MyApp> createState() => _MyAppState(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
// simulate the import of audioplayers flutter package | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatefulWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override | |
State<MyApp> createState() => _MyAppState(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(const MaterialApp(home: MyApp())); | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Welcome to Currency Converter!"); | |
console.log(`1 USD equals 1 USD | |
1 USD equals 113.5 JPY | |
1 USD equals 0.89 EUR | |
1 USD equals 74.36 RUB | |
1 USD equals 0.75 GBP`); | |
console.log("I can convert USD to these currencies: JPY, EUR, RUB, USD, GBP"); | |
console.log("Type the currency you wish to convert: USD"); | |
// currency? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import the readline module | |
let rl = require('readline').createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}); | |
console.log("Welcome to Currency Converter!"); | |
console.log(`1 USD equals 1 USD | |
1 USD equals 113.5 JPY | |
1 USD equals 0.89 EUR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let input = require('sync-input'); | |
console.log("Welcome to Currency Converter!"); | |
console.log(`1 USD equals 1 USD | |
1 USD equals 113.5 JPY | |
1 USD equals 0.89 EUR | |
1 USD equals 74.36 RUB | |
1 USD equals 0.75 GBP`); | |
console.log("I can convert USD to these currencies: JPY, EUR, RUB, USD, GBP"); | |
console.log("Type the currency you wish to convert: USD"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let colors = ["red", "green", "blue", "yellow"]; | |
let favColor = "pink"; | |
(function check() { | |
let output = 0; | |
for(color in colors) { | |
// console.log(colors[color]); | |
if(colors[color] == favColor) { | |
output = "I found your favorite color, color " + colors[color]; |
OlderNewer