Questions tagged [initials]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
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
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
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
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
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[] ...
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
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
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
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
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
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
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
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
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
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
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
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 ...
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), ...
-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
vote
2answers
220 views

Initials runs, but no output

I run this program in my terminal and it compiles right, but I don't quite understand why, when I type something, no output is printed and the blinking prompt with the home directory shows up again. I ...
0
votes
1answer
76 views

PSet2 Initials.c 'more comfortable'

Glad to be here. I have a slight issue. I have searched and I want to avoid using 'isalpha' if I can. That seems like the easy way out but I just can't find out how the last 2 checks on the check50 ...
0
votes
1answer
45 views

Infinite loop in pset2 Initials

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> int i; int main (void) { printf("Your Name: "); string s = get_string(); if (s !=NULL) { printf("%...
0
votes
1answer
108 views

Any help with initials(more comfortable) in pset2 is greatly appreciated

Please help me with some advice on completing this problem. I can print out the first letter of someone's first name, but I do not know how to go about printing out the first letter in someone's ...
0
votes
1answer
40 views

Initials, more: Can't get it to loop back after 1 letter

The "more comfortable" version seemed most interesting, so I gave it a shot. //declare the string "nms" and prompt for string input printf("What is your name?\n"); string nms=get_string(); /...
0
votes
1answer
61 views

Initials: Not printing second initial

I'm having some trouble getting started with the initials problem. Currently, if the user inputs: John Smith, only J is printed. I'm assuming the program automatically exits after the first print ...
0
votes
1answer
70 views

pset 2 initials: trouble printing only first char and char after space

So here is my current approach. I'm struggling with printing only the first character and the first character after a space in the problem. I feel like I'm pretty close but can't seem to figure out ...
0
votes
1answer
55 views

PSET2 initials.c Once again, appears to compile and run just fine, check50 fails me across the board

include #include <cs50.h> #include <string.h> int main(void) { //get user name through stdin printf("Please enter your name: "); int lastChar = 32; string a = get_string(...
0
votes
1answer
107 views

initials.c accounting for when only 1 or 2 names are entered

this is my first time on the forum, I am trying initials.c on pset2, I have managed to do the code which gets the first letter of the word and capitalizes it. My problem is when the user enters just a ...
0
votes
1answer
46 views

pset2: initials - strange output with certain array sizes

I noticed a strange behaviour in my code. With specific size assigned to the array used for storing the initials, there are some extra characters stored in the initials array. Below is the code that ...
0
votes
1answer
71 views

pset2 initials check50 bug, doesn't recognize the output

Click here to see the code, initially I've written a simplified version in the main function and it passed all the tests, and then I made the general function seen in the link provided and now it ...
0
votes
1answer
221 views

pset2: initials - check50

First thank you all for taking the time to help! Working on more initials (more comfortable) and here's the problems: 1) From what I see the code gets correct results but check50 doesn't agree. Can ...
0
votes
1answer
170 views

Initials more pset2

I do not understand why my first name is printing the same letter twice
0
votes
1answer
40 views

Access array element by index ERROR

I probably miss something very obvious here. I have a simple program (code below), which gives me error: "format specifies type 'char *' but the argument has type 'char'". I tried changing it to char ...
0
votes
1answer
164 views

initials-more - check50 says output is correct yet still fails

Bizarre question! Here's the results for my check50 on my initials-more problem: https://cs50.me/checks/815aa9b0c96b6d2a3df539987aa9d8829c5200af It shows that my output returns "HJ" as it should do -...
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
484 views

check50 not working 2017 for initials

I copied check50 cs50/2017/x/initials/less like shown on pset2 and i get the "Checking. invalid ID" error. I added initials.c at the end and nothing.
0
votes
1answer
53 views

expected output, but not “MB\n”

check50_more report : :) initials.c exists :) initials.c compiles :) outputs "MB" for "Milo Banana" :) outputs "MB" for "milo banana" :( outputs "MB" for " milo banana " \ expected output, but ...
0
votes
1answer
150 views

Pset2 initials, how to get to second word

please dont laugh at me as i am totally new to programming, and on top of that maybe not very smart. I am just enjoying a lot what i am learning though i am afraid i will not be able to finish the ...
1
vote
2answers
840 views

Cs50 problem set 2 Initials

everyone! I have one problem with code initials. It correctly runs but after check50 I've got some issues , among them- ***\ expected output, but not " \u0000\n"***that I can't fix.Help me,please) #...
0
votes
1answer
350 views

Pset2 initials.c is graded as zero?

I'm taking cs50 through edX, and received a grade of zero for initials.c in pset2 even though it is working correctly. I wasn't sure where or who to direct this question to. Thx.
0
votes
1answer
150 views

Intitials.C Works With Command Line Arguments - How do I make it work with a prompt?

My code for initials.c works with command line arguments, but how do I make it work with a string? And how do I make it work with multiple names that include spaces? I have tried to make it work with ...
0
votes
2answers
162 views

pset 2 initials (less); “expected prompt for input, not output of…”

I've implemented the code for pset 2 initials (less) and it seems to be working, however, when I test it I get an error I'm struggling to understand. Any help would be greatly appreciated. Below is ...
0
votes
1answer
447 views

Initials, but I did it with argv and argc, how do I use get_string?

I made this program that takes a name and prints the initials, but...it takes the name in the command line. How can I use get_string() to create an array of strings instead of argv, and argc wich is ...
0
votes
1answer
482 views

Problem with pset-2 initials.c (more comfortable)

I'm new to programming and I have solved the less comfortable version of initials.c in pset2 but I'm having trouble with the output of more comfortable version of initials.c. Here's my code: #...
0
votes
2answers
193 views

pset2 initials.c, returning first initial

I originally used a for loop (for(int i = 0, n =strlen(name); i < n ; i++), but decided to try a while loop setting i=1. Either way my output is always limited to the first character. I've tried ...
0
votes
1answer
83 views

pset2 segmentation fault

I have one problem with this code please help me! #include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> int main(void) { ...
1
vote
1answer
51 views

pset2 Initials - negative index

I finished the Initials (more comfortable) problem, but when trying to detect initials, I'd like to avoid negative indeces. Here's what I used for the detection of initials, if it's not a space at ...
0
votes
1answer
129 views

Pset 2 - Initials help

Have the following code for Pset 2 initials (more) #include <stdio.h> #include <cs50.h> #include <ctype.h> #include <string.h> int main(void) { string name = get_string(); ...
0
votes
2answers
96 views

Help with Initials.c - programme prints '!' after initials, and other problems?

I feel like if I don't seek help from this forum I will end up finishing my CS50 course in 2020 :'( #include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> ...