Skip to content

Instantly share code, notes, and snippets.

Avatar
🤞
Hopeful

Fardeen Panjwani wise-introvert

🤞
Hopeful
View GitHub Profile
@wise-introvert
wise-introvert / worldcities.json
Last active Jan 23, 2023
A large json dataset to help stress test functions
View worldcities.json
This file has been truncated, but you can view the full file.
[
{
"admin_name" : "Tōkyō",
"capital" : "primary",
"city" : "Tokyo",
"city_ascii" : "Tokyo",
"country" : "Japan",
"id" : "1392685764",
"iso2" : "JP",
"iso3" : "JPN",
View README.md
View ipc-finals-question-4-answer.txt
1: Import the Standard Input Output library
3,4,5,6: Define four macros:
a. MAX_JUDGES
b. MAX_STRING
c. MAX_CONTESTANTS
d. WINNER_CUTOFF
8. Declare a struct called "Score" with the following datatypes:
a. "judgeScore": an array of doubles with a maximum capacity of 3
13. Declare a struct called "Contestant" with the following datatypes:
a. "name": an array of characters with a maximum capacity of 25
View ipc-finals-question-3-answer.txt
----------------------------------------------BUGS----------------------------------------------
======== BUG 1 ========
Original Line: 13, 16
Issue: Case-sensitive comparision of characters
What was done: Used the "tolower" function from the ctype library to convert both the characters being compared to lowercase
Original Code:
View steps.txt
1. Import the standard input and output library
2. Import the String helper library
3. Define a macro called SZ and set it to 31
4. declare a character array of size "SZ" (31) called "str1" and set it to "Charlotte's"
5. declare a character array of size "SZ" (31) called "str2" and set it to "Spider's web"
6. declare a character array of size "SZ" (31) called "str3" and initialize it with one item: 0
7. Concatenate the value of str1 and the address of the value at index 9 in the str2 array using the strcat method provided by the string helper library
8. Compare the value of str1 with "Charlotte's web" using the strcmp method.
9. If the result from step 8 is false, execute the contents in the if block (since the condition is prepend with the not (!) operator ): copy the string "is the" to the value of str3
10. If the result from step 8 is true, execute the contents in the else block (since the condition is prepend with the not (!) operator ): copy the string "is not the" to the value of str3
View w7.c
#include <stdio.h>
struct employee {
int empId;
float salary;
};
int main(void) {
int i;
float total_salary = 0.0;
View combined.pseudocode.txt
START
SET "state" = "green"
SET "isAdvanceActive" = "true"
SET "timer" = 40 and begin auto-decrement
## Get current time
GET "timer" value
## Check if 4-light/5-states system is active
View w2p1.sukhjeevan.c
/*
* AUTHOR <your name>
* EMAIL <your seneca email id>
* SENECA ID <your seneca id>
* DESCRIPTION <description>
*/
#include<stdio.h>
#include<math.h>
@wise-introvert
wise-introvert / w2p2.c
Last active Sep 24, 2021
Week 2 Part 2
View w2p2.c
/*
* AUTHOR <your name>
* EMAIL <your seneca email id>
* SENECA ID <your seneca id>
* DESCRIPTION Print message to the screen
*/
#include<stdio.h>
#include<math.h>
@wise-introvert
wise-introvert / w2p1.c
Last active Sep 24, 2021
Week 2 Part 1
View w2p1.c
/*
* AUTHOR <your name>
* EMAIL <your seneca email id>
* SENECA ID <your seneca id>
* DESCRIPTION Print message to the screen
*/
#include<stdio.h>
#include<math.h>