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
const menu = { | |
//meal and price properties | |
_meal: "", | |
_price: 0, | |
//setting meal and check if input is a string | |
set meal(mealToCheck) { | |
this._meal = typeof mealToCheck === "string" ? mealToCheck : "invalid"; | |
}, | |
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
#include <ctype.h> | |
#include <cs50.h> | |
#include <stdio.h> | |
#include <string.h> | |
// Points assigned to each letter of the alphabet | |
int points[] = {1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10}; | |
int compute_score(string word); |
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
#include <cs50.h> | |
#include <stdio.h> | |
#include <math.h> | |
int main(void) | |
{ | |
// promptig user for input | |
long card= get_long("CARD NUMBER: "); | |
int i = 0; |
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
#include <cs50.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <string.h> | |
#include <math.h> | |
//prototypes | |
int count_letters(string x); | |
int count_words(string x); | |
int count_sentences(string x); |
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
#include <cs50.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
int height; //assign a value to an int named Height | |
do // using do function to prompt user for an input at least one time | |
{ | |
height = get_int("Height(1-8): "); | |
} |
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
#include <cs50.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
// prototypes | |
bool only_digits(string x); | |
char rotate(char x, int i); |
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
#include <cs50.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
// prototypes | |
bool only_alpha(string x); | |
char substitute(char x, string y); |