Questions tagged [logic]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

logical sentences

The following question will ask you about the following logical sentences. If Hermione is in the library, then Harry is in the library. Hermione is in the library. Ron is in the library and Ron is ...
0 votes
0 answers
87 views

first order logic sentence

Consider, in first-order logic, the following predicate symbols. Student(x) represents the predicate that "x is a student." Course(x) represents the predicate that "x is a course." ...
0 votes
2 answers
53 views

Else If Boolean Statements of Equality In the Case of Complex Numbers

In the lecture for Week 1, Professor Malan said that in an if statement, the third boolean expression (else if (x ==y)) is redundant or implied, since logically, if it is false that a number is ...
0 votes
1 answer
34 views

Expected expression on "valid triangle" exercise? i thought the 'or' symbol was 2 lines ( || ) what have i done wrong here?

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> // PROTOTYPE THE FUNCTON bool valid_triangle(float input1, float input2, ...
0 votes
2 answers
33 views

Can anyone tell me what ive done wrong and breakdown how to properly prototype and deploy created functions?

code: #include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> // PROTOTYPE THE FUNCTONS & DECLARE VARIABLES int multiply(int ,...
0 votes
1 answer
78 views

Can anyone explain this chart from the "dynamic programming" lecture in a different way?

I'm having trouble understanding how this table is constructed. A little before this point in the lecture, we get to take a look at this table. However, he explains the table by basically trying to ...
0 votes
1 answer
50 views

pset 4 resize (more confortable) pixel loss logic

I managed to write the correct output file headers, but when I went to actually implementing the resize logic, things got a bit complicated. I can pretty much understand factors of resize bigger than ...
0 votes
1 answer
273 views

Im badly struggling with the logic for caesar pset 2

As title suggests I am really struggling with the logic in doing this...and its really making me think its not for me. But I WILL not give up! The actual coding and telling the computer what to do ...
0 votes
1 answer
183 views

Pset2, caesar: string characters not working with is alpha logic?

I have run the debugger tested different combinations in my code, but I can't figure out why nothing is functioning. I input abc, I output abc. My program seems to determine all characters from the ...
2 votes
1 answer
2k views

should I create a table for every user on buy, cs50 finance

here is my pseudocode for the buy method: if the request method is post: remember symbol if provided, if not return apology check if symbol is valid via lookup() remember shares if it exists and ...
1 vote
2 answers
839 views

Pset1(mario.less)- What is the logic behind my approach?

This has been a bit, -a brain-teasing challenge for me for maybe two days-, and actually still is. After trying several times to solve this "logically" or "systematically" and unfortunately failing ...