Questions tagged [lab1]
The lab1 tag has no usage guidance.
20
questions
0
votes
1
answer
8
views
Lab 1 - Terminal goes blank after I input end size
The terminal goes blank after I input end size. What am I doing wrong?
#include <cs50.h>
#include <stdio.h>
int main(void)
{
// TODO: Prompt for start size
int start;
do
{
...
0
votes
1
answer
28
views
expression result unused on a subtraction symbol in a do-while loop
popGrowth.c:12:17: error: expression result unused [-Werror,-Wunused-value]
do x + (x/3)-(x/4); while (x < y);
~~~~~~~~~^~~~~~
Overall I am trying to complete an action to a start ...
0
votes
0
answers
101
views
Lab 1, error "check50 is taking longer than normal!"
I am on lab1 and when I go to check50 there is the following error:
this is taking longer than normal!
It is the same thing when I go to style50 but it says it failed to connect to servers.
This is ...
0
votes
2
answers
48
views
Stuck on Lab 1 #CS50
I'd appreciate your help as I'm stuck on the last part of Lab 1.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
// TODO: Prompt for start size
int start;
do
{
...
0
votes
1
answer
11
views
can't check until lab turns upside down lab 1
This is where my issue is coming from
// TODO: Calculate number of years until we reach threshold
int n = start;
int years = 0;
while (start < end)
{
n = n + (n / 3) - (n / ...
0
votes
0
answers
10
views
Cannot submit Lab1 project
I made folder called lamas and put my project in that. Cannot submit project as system doesnt recognise lamas. Needs to be population. How can I delete all existing folders in Git ( my code is saved ...
0
votes
1
answer
23
views
Thanks Cliff B, yes so far so good, now error is while loop has empty body, it sounds like the loop has nothing to refer to , to make the loop work
{
//Prompt for start size
int start;
do
{ start = get_int("start: ");
}
while (start < 9 );
// Prompt for end size
int end;
do
{
end = get_int("...
1
vote
0
answers
75
views
rejects invalid populations and then handles population 20
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int n;
int End;
// TODO: Prompt for start size
do
{
n = get_int("Start size: ");
}
while ( n < 9);
// TODO: Prompt for ...
1
vote
2
answers
152
views
I don't what number means in PRIME/LAB1
everyone, I've stuck with this problem for a few days, I found some kind of resolution for it, but I don't understand what means number. I will really appreciate if anyone can explain me more
0
votes
1
answer
32
views
My while loop runs an extra time (Lab 1)
My while loop in this runs an extra time, for example when I set the start size as 1200 and the end size as 1300, it gives me the answer as 2 years instead of 1.
#include <cs50.h>
#include <...
0
votes
1
answer
254
views
Lab 1 population growth
I've made the following code which is supposed to calculate the number of years it takes to reach a goal population assuming the population grows by 1/3 every year and 1/4 dies, as required in the lab ...
0
votes
1
answer
98
views
Can't seem to get total number of years to print properly in Lab 1
I'm new to coding and I've been having trouble with Lab 1. I was able to get the program to properly ask for a start and end size, but the number of years is not listed.
Here's an example:
population/ ...
0
votes
1
answer
186
views
cs50.h: No such file or directory
I am coding at online vscode(connect with gitHub).
I am trying CS50 Lab1 and I followed the steps but the error appeared.
I've searched the answer but most of them are aim at local surroundings not ...
0
votes
2
answers
24
views
Getting > as the directory instead of the ~
I accidentally clicked some buttons and changed the directory to > but I'm unsure how to change it back. Please help its preventing me from moving forward. I really really appreciate it!
1
vote
0
answers
166
views
I can't submit lab1 on CS50 2021
I can't submit my lab, I generated the code from Github, but the terminal keeps telling me that "Submission cancelled. You might be using your GitHub password to log in, but that's no longer ...
0
votes
1
answer
78
views
Lab "population' Why is it when i put 18 as an end population, the loop for 'start date' is initiated again after there being a condition of (e < s)?
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int counter = 0;
int apop;
int e;
// TODO: Prompt for start size
do
{
int s;
do
{
...
0
votes
1
answer
82
views
population lab compiles , but wrong years
it compiles but wrong years
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int n,e;
do
{
n = get_int("Start Size:");
} while (n < 9);
do
...
0
votes
1
answer
82
views
the code which is expected and my actual code are the same but check50 see it as incorrect LAB1
#include <cs50.h>
#include <stdio.h>
int main(void)
{
// TODO: prompt for the start size
int n;
do
{
n = get_int("start size: ");
}
...
1
vote
1
answer
2k
views
Why is my lab1 code failing to pass one test in check50?
First, let me share my code:
int main(void)
{
int x = 1, y, n = 0, year;
do
{
x = get_int("Enter the starting population size: "); // TODO: Prompt for start size
}
...
0
votes
1
answer
160
views
I don't understand the comments from check50 on my lab 1 submission. could anyone help please?
This is my code
#include <cs50.h>
#include <stdio.h>
int main(void)
{
// TODO: Prompt for start size
int s;
do
{
s= get_int("Start size: ");
}
...