Questions tagged [pennies]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
59 views

CS50 AP: Pennies

I'm wondering why a lot of my answers are off by 0.01 or a very small amount. Here are the results from check50: :) pennies.c exists :) pennies.c compiles :( 28 days, 1 penny on day one yields $...
1
vote
2answers
190 views

I can´t get (pset1) greedy/cash.c pennies to work properly!

i´ve been trying to figure out what is wrong with my code for the pset1 cash or greedy program, i know about float imprecision but when i print the last value for "ch" it prints .01000, thus meaning ...
0
votes
1answer
737 views

Solution to Pennies yields slightly different answer than check50

Today, I attempted to solve the problem in chapter 1 entitled pennies. When I run my program, the outputs I get are equal to those that I get by manually computing the number of pennies with a ...
0
votes
1answer
94 views

pset1 pennies problem give a slightly wrong result

I am getting a slightly different result from what asked in the pset. In fact my code will give as a result $107374184.0000 instead of $10737418.23, but I don't understand where is the problem. Thanks ...
0
votes
1answer
99 views

problem set1 pennies

I have another problem of imprecision with float numbers. #include <stdio.h> #include <math.h> #include <cs50.h> int main(void) { float z = 32212254690; float y = z / ...