Questions tagged [initials]

The tag has no usage guidance.

23 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
1answer
202 views

pset2 Initials Design Improvements

I was hoping you might be able to help me improve the design of my code. I've solved the initials problem, and it passes check50 on both normal and hacker edition (the hacker edition was incidental), ...
0
votes
1answer
116 views

CS50x - Problem Set 2 - Initials (less)

I've managed to whip up a solution in Python 3 that seems to work. name = input("") initials = name[0] for i in range(0, len(name)): if (name[i].isspace()): initials += name[i + 1] ...
0
votes
0answers
35 views

Logic issue with Initials

I have tried to write the program for initials under the following logic: if there is weird spacing -- > there is a space at the start OR 2 or more space are found together in the string if there is ...
0
votes
1answer
115 views

problem with pset 2 initials (more confortable)

im having a problem with initials (More Confortable) in Pset2. The ckeck50 software outputs this: : ( outputs "MB" for " milo banana " \ expected output, but not "MB\u0000\n" But when i try to run ...
0
votes
1answer
140 views

pset2(Alternative Solution opinion

I know theirs a billion ways to implement a solution , heres what i came up with and it passed all the tests. What do you guys think int main(void) { string name = get_string(); void ...
0
votes
1answer
66 views

PSET2 Initials.c initials not being printed out at all

My code just stops after I get the string from the user, and I'm not sure why it isn't continuing. Any pointers? int main (void) { printf("What is your full name?\n"); string s = get_string()...
0
votes
1answer
144 views

Problem with Pset2

Please help me with this program i have compile it hundred times and run check50 and submit50 command but it keeps on saying this and also submission cancel do you mean to submit something please ...
0
votes
1answer
143 views

Pset 2 Initials less comf my code works and passes the test but I would like to know how differenlty could have been implemented

I got initials less comf. pretty quickly thankfully but I would like to know how you guys have implemented the code differently than me. https://gist.github.com/a50582c43587cd3c45d38e9e0c4f956a
0
votes
1answer
98 views

am on pset2(morecomfortable), the code gives me the desired result but it doesnt pass the check

#include <cs50.h> #include <stdio.h> #include <string.h> #include <ctype.h> int main(void) { string name = GetString(); for (int i = 0, n = strlen(name); i < n; i++)...
0
votes
1answer
104 views

pset2 How to get rid of spaces in the end of the milo banana_ _ _ _ (input)?

How to get rid of spaces in the end of the input? My code works perfectly with _ _ milla_ _ _ banana But I have issues with the case if _ _ _ milla_ _ banana_ _ _ when I have spaces in the end How ...
0
votes
1answer
159 views

Pset 2 Initials - Function Help

I've written a successful program to complete the Initials section of Pset2 without the use of any functions. However, seeing as I needed to copy/paste a good chunk of code in my program I've decided ...
0
votes
2answers
311 views

Help! Problems on pset2 initials

I have a problem of running this code. when i try to complie, it keeps repeating on the same warnings. Here's my code. Here's the warning: initials.c:14:12: error: expression result unused [- Can ...
0
votes
1answer
449 views

Don,t know why it is not printing each char after space

I have written this code to print first char and each subsequent char after "space" to be printed, but it is only printing first char what is the problem. #include <stdio.h> #include <cs50.h&...
0
votes
2answers
94 views

Initials.c isnt working properly

This is my code #include <cs50.h> #include <stdio.h> #include <ctype.h> int main(){ int i=0; printf(""); char* str = GetString(); printf("%c",*str); while(str[i]!='\...
0
votes
1answer
141 views

PSET2 Initials task

My code has a bug in it which make it output the first initial after the second, would someone please be able to help me and describe what is wrong without having to change my whole code as it all ...
0
votes
2answers
293 views

pset2 initials checking problem?

So I wrote my code for initials and when I test it myself everything runs perfectly, but when I check it using check50 2015.fall.pset2.initials initials.c the checking program says that I have the ...
0
votes
3answers
278 views

pset2 initials video

I have figured out how to do some of this on my own, but I've spent over an hour just searching for the videos on the subject! I have no idea where the uppercase was introduced, or where pulling ...
0
votes
2answers
178 views

Pset2 Initials, will only get output if there is /n

I only seem to get an output when the 2nd %c is followed by \n. When it is there, the initials print, but they are subsequently on different lines. This is due to the \n. But when I remove it, ...
0
votes
0answers
123 views

Is there a better way to implement hacker2-initials?

for hacker2 initials, I can get the right answer, but I want to know is there any other way that works more efficiently? Thanks!
0
votes
1answer
243 views

I've use array pointer method in pset2 (initials.c) but it return "Segmentation Fault (Core Dump) Why?

I'm working on pset2 using array pointer method, but unfortunately, the program return "Segmentation Fault (Core Dump)" I've post a picture of my code below.Can I use this method? or I have to use if ...
0
votes
1answer
374 views

Approach to pset 2?

I'm having problems with pset2 initials. My approach to it is to ask the user for input, and store that input into an array and print the individual initials from there. However, when I use the argv[] ...
-1
votes
1answer
71 views

pset 2 Initials - Only printing first letter and new line

Can't for the life of me see why this only prints the first letter! Any help would be greatly appreciated. #include <cs50.h> #include <stdio.h> #include <string.h> #include <...
-1
votes
2answers
122 views

Is my function written correct?

I just finished the initials.c problem. I tried making it with my own function "initialize()". Is it written correct? // Prototypes int initialize(string name); int main(void) { string name = ...