This file contains 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
const currency = [ | |
{ | |
currency_name: 'Afghani', | |
currency_code: 'AFN' | |
}, | |
{ | |
currency_name: 'Lek', | |
currency_code: 'ALL' | |
}, | |
{ |
This file contains 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 java.util.Scanner; | |
public class CardChecker { | |
/** Main Method */ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); // Create a Scanner | |
// Prompt the user to enter a credit card number as a long integer | |
System.out.print("Enter a credit card number as a long integer: "); | |
long cardNumber = input.nextLong(); |
This file contains 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
Question (1) | |
let sum = 0 | |
for (let i = 0; i<= 1000; i++){ | |
if(i % 3 === 0 || i%5 === 0) { | |
sum = sum + i; | |
} | |
} | |
console.log(sum) |
This file contains 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
<?php | |
$jack = dog; | |
if($jack==Dog){ | |
echo “jack is a dog”; | |
} | |
else{ | |
echo “jack is a man” | |
} | |
?> |
This file contains 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
<?php | |
$x = dog | |
echo strlen($x);//this print the number of number of letters in the variable | |
echo ucwords($X);//this converts the first character of each word in a string to uppercase | |
echo ucfirsts($x);//Converts the first character of a string to uppercase | |
?> |
This file contains 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
<?php | |
$x = 5 //integer: you can see its a number | |
$y = “hello world” //String: you can its a word | |
$y = true // Boolean: This is can represent two state, true or false | |
?> |
This file contains 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
<?php | |
$varible = “hello from the other side”; | |
$variable1 = “I must have called a thousand times”; | |
echo $variable | |
echo $variable1 | |
echo “$variable $variabel1”; | |
echo $variabel.’ ‘ . $variable; | |
?> |